mkdir trim ;
for i in *.R1.fastq.gz ; do i=${i%.R1.fastq.gz*} ; cutadapt -j 20 --trim-n --match-read-wildcards -u 3 -n 4 -a AGATCGGAAGAGCACACGTCTG -a AAAAAAAA -a GAACTCCAGTCAC -e 0.2 --nextseq-trim 20 -m 15 -o trim/${i}.trimmed.fastq.gz ${i}.R1.fastq.gz ; done ; cd trim/; for i in *.trimmed.fastq.gz ; do i=${i%.trimmed.fastq.gz*}; bowtie --seedlen=23 --threads=80 --un ${i}.norrna.fq --sam /data/reference/mouse-rRNA/all.mouse.rRNA ${i}.trimmed.fastq.gz ; done
for i in *.trimmed.fastq.gz ; do i=${i%.trimmed.fastq.gz*}; bowtie --seedlen=23 --threads=80 --sam /data/reference/GRCM38-tRNA/gencode.vM25.tRNAs ${i}.trimmed.fastq.gz > tRNA/${i}.sam ; done
for i in *.norrna.fq ; do i=${i%.norrna.fq*}; STAR --genomeDir /data/reference/GRCM38-V81-gencode/STAR/ --runThreadN 5 --readFilesIn ${i}.norrna.fq --outFilterMismatchNmax 1 --outFileNamePrefix ${i} --quantMode TranscriptomeSAM GeneCounts --outSAMtype BAM SortedByCoordinate --outBAMsortingThreadN 5 --outWigType wiggle --outWigNorm RPM --outReadsUnmapped Fastx --outFilterMatchNmin 20 --alignEndsType Local ; done
for i in *.R1.fastq.gz ; do i=${i%.R1.fastq.gz*} ; zcat ${i}.R1.fastq.gz | wc -l ; done ; for i in *.R1.fastq.gz ; do i=${i%.R1.fastq.gz*} ; zcat ${i}.R1.fastq.gz | grep AAAAAAA | wc -l ;done ;
cd trim ; for i in *.trimmed.fastq.gz ; do i=${i%.trimmed.fastq.gz*}; zcat ${i}.trimmed.fastq.gz | wc -l ; done ; for i in *.norrna.fq ; do i=${i%.norrna.fq*}; wc -l ${i}.norrna.fq ; done
for i in *.final.out ; do i=${i%.final.out*} ; wc -l ${i}.final.out ; done ;
for i in *.final.out ; do i=${i%.final.out*} ; grep "Number of input reads" ${i}.final.out ; done ;
for i in *.final.out ; do i=${i%.final.out*} ; grep "Uniquely" ${i}.final.out ; done