comparison monorail.sh @ 4:ae546ad6f2f4 draft

Uploaded
author chrisw
date Tue, 12 Feb 2019 11:56:25 -0500
parents a25fa2b5e379
children d2d9937d1f9c
comparison
equal deleted inserted replaced
3:b08c5567f2f0 4:ae546ad6f2f4
1 set -o pipefail -o errexit 1 set -o pipefail -o errexit
2 #get this script's path
3 #p=`perl -e '@f=split("/","'$0'"); pop(@f); print "".join("/",@f)."\n";'`
4
5 #/data7/miniconda2/envs/_galaxy_18.09/bin:/data7/miniconda2/condabin:/home/cwilks/.nimble/bin:/data/pypy3-v6.0.0-linux64/bin:/home/cwilks/zstd_dir:/data/bedtools2/bin:/usr/local/cuda-8.0/bin:/home/cwilks/Python3/bin:/data2/sqlite-autoconf-3110000.fts5:/data/java/bin:/data/ant/bin:/home/cwilks/anaconda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/cwilks/samtools-1.2:/home/cwilks/samtools-1.2/htslib-1.2.1:/data/WiggleTools/bin:/data/kent_tools:/data2/liftover:/home/cwilks/bin
6 2
7 path2=$PATH 3 path2=$PATH
8 #starp=`/bin/which STAR`
9 #stp=`/bin/which samtools`
10 4
11 #e.g. /data7/references/ath10/star_idx 5 #e.g. /data7/references/ath10/star_idx
12 ref=$1 6 ref=$1
13 #e.g. 4 7 #e.g. 4
14 threads=$2 8 threads=$2
21 #e.g. tmp/SRR8505407_SRP182756_ath10_sra_1.fastq.gz 15 #e.g. tmp/SRR8505407_SRP182756_ath10_sra_1.fastq.gz
22 reads1=$6 16 reads1=$6
23 #e.g. tmp/SRR8505407_SRP182756_ath10_sra_2.fastq.gz, just leave off if not paired 17 #e.g. tmp/SRR8505407_SRP182756_ath10_sra_2.fastq.gz, just leave off if not paired
24 reads2=$7 18 reads2=$7
25 19
26
27 #racc=`perl -e '$r1="'${reads1}'"; @f=split(/\//,$r1); $r1=pop(@f); ($n1)=split(/[\._]/,$r1); print "$n1\n";'`
28
29 #cd ${tmp}
30 #align 20 #align
31 STAR --runMode alignReads --runThreadN $threads --genomeDir ${ref} --readFilesIn $reads1 $reads2 --readFilesCommand zcat --twopassMode None --outReadsUnmapped Fastx --outMultimapperOrder Random --outSAMreadID Number --readFilesType Fastx --outTmpDir ./star_tmp --outSAMtype BAM Unsorted --outSAMmode NoQS --outSAMattributes NH MD --chimOutType Junctions --chimOutJunctionFormat 1 --chimSegmentReadGapMax 3 --chimJunctionOverhangMin 12 --chimSegmentMin 12 > star.log 2>&1 21 STAR --runMode alignReads --runThreadN $threads --genomeDir ${ref} --readFilesIn $reads1 $reads2 --readFilesCommand zcat --twopassMode None --outReadsUnmapped Fastx --outMultimapperOrder Random --outSAMreadID Number --readFilesType Fastx --outTmpDir ./star_tmp --outSAMtype BAM Unsorted --outSAMmode NoQS --outSAMattributes NH MD --chimOutType Junctions --chimOutJunctionFormat 1 --chimSegmentReadGapMax 3 --chimJunctionOverhangMin 12 --chimSegmentMin 12 > star.log 2>&1
32 22
33 sout="Aligned.out.bam" 23 sout="Aligned.out.bam"
34 24
37 samtools sort -T ./samtools_temp -@ $threads -m 64M -o $sorted_bam $sout > stools.log 2>&1 27 samtools sort -T ./samtools_temp -@ $threads -m 64M -o $sorted_bam $sout > stools.log 2>&1
38 #index 28 #index
39 samtools index -@ $threads $sorted_bam >> stools.log 2>&1 29 samtools index -@ $threads $sorted_bam >> stools.log 2>&1
40 30
41 #get coverage summaries 31 #get coverage summaries
42 #bamcount $sorted_bam --threads $threads --coverage --no-head --require-mdz --min-unique-qual $min_uniq_qual --frag-dist bc --bigwig bc --annotation $annotation bc --auc bc --lats bc > bc.log 2>&1 32 bamcount $sorted_bam --threads $threads --coverage --no-head --require-mdz --min-unique-qual $min_uniq_qual --frag-dist bc --bigwig bc --annotation $annotation bc --auc bc --lats bc > bc.log 2>&1
43
44 #echo $PATH > ${sorted_bam}.bai
45 #echo $starp >> ${sorted_bam}.bai
46 #echo $stp >> ${sorted_bam}.bai