Skip to content

Commit 50aa66c

Browse files
author
scu56292
committed
fixing code
1 parent da07bd5 commit 50aa66c

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/usr/bin/env bash
2+
MY_PWD=$1
3+
cd $MY_PWD
24

3-
MY_PWD=$(pwd)
45

56
# Run QC for MNase-seq samples
67

7-
/home/tools/nextflow run nucMACC \
8+
nextflow run nucMACC \
89
--analysis 'MNaseQC' \
910
--csvInput $MY_PWD'/data/samples.csv' \
1011
--outDir QC_out \
1112
--genomeIdx $MY_PWD'/data/Bowtie2Index/genome' \
1213
--genomeSize 162367812 \
1314
--publishBamFlt \
14-
--TSS $MY_PWD'/data/genes.gtf'
15+
--TSS $MY_PWD'/data/genes.gtf'
Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
#!/usr/bin/env Rscript
2-
3-
# set working directory
41
setwd("QC_out/")
5-
6-
# save working directory as pathSTD
72
pathSTD<-getwd()
3+
library(stringr)
4+
5+
86

9-
# list mono-nucleosome and sub-nucleosome BAM files
107
files.mono<-list.files("RUN/00_ALIGNMENT/monoNuc/")
118
files.sub<-list.files("RUN/00_ALIGNMENT/subNuc/")
129

13-
# Change sample name by splitting at "_MNase_" and taking the first part
14-
Sample_Name <- sapply(strsplit(files.mono, "_MNase_"), `[`, 1)
10+
##sample name
11+
Sample_Name<-files.mono %>%
12+
str_split_i("_MNase_",1)
13+
14+
replicate<-files.mono %>%
15+
str_split_i("_",5)
16+
1517

16-
# Extract replicate number by splitting at "_" and taking the sixth element
17-
replicate <- sapply(strsplit(files.mono, "_"), `[`, 6)
18+
MNase_U<-files.mono %>%
19+
str_split_i("_",3) %>%
20+
str_sub(1,-2)
1821

19-
# Extract MNase units by splitting at "_" and taking the fourth element, then removing the last character
20-
MNase_U <- sapply(strsplit(files.mono, "_"), function(x) substr(x[4], 1, nchar(x[4])-1))
2122

22-
# create data frame with sample name and corresponding file names for mono- and sub- nucleosomes
2323
df<-data.frame(Sample_Name=Sample_Name,
2424
replicate=replicate,
25-
path_mono=paste0(pathSTD,"/RUN/00_ALIGNMENT/monoNuc/",files.mono),
26-
path_sub=paste0(pathSTD,"/RUN/00_ALIGNMENT/subNuc/",files.sub),
27-
MNase_U)
25+
path_mono=paste0(pathSTD,"/RUN/00_ALIGNMENT/monoNuc/",files.mono),
26+
path_sub=paste0(pathSTD,"/RUN/00_ALIGNMENT/subNuc/",files.sub),
27+
MNase_U)
2828

29-
# write .csv file with sample names and paths
3029
write.csv(df, row.names = F,
31-
file = paste0(pathSTD,"/data/samples_nucMACC.csv", quote = F)
30+
file="../data/samples_nucMACC.csv", quote = F)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/usr/bin/env bash
2-
3-
MY_PWD=$(pwd)
2+
MY_PWD=$1
3+
cd $MY_PWD
44

55

66
# Run the nucMACC pipeline
77

8-
/home/tools/nextflow run nucMACC \
8+
nextflow run nucMACC \
99
--analysis 'nucMACC' \
1010
--csvInput $MY_PWD'/data/samples_nucMACC.csv' \
1111
--outDir Run_out \
1212
--genomeIdx $MY_PWD'/data/Bowtie2Index/genome' \
1313
--genomeSize 162367812 \
1414
--genome $MY_PWD'/data/genome.fa' \
1515
--bamEntry \
16-
--TSS $MY_PWD'/data/genes.gtf'
16+
--TSS $MY_PWD'/data/genes.gtf'

0 commit comments

Comments
 (0)