Skip to content
Snippets Groups Projects
Commit b54812cf authored by Brandi Cantarel's avatar Brandi Cantarel
Browse files

update support single-end

parent b6d2f689
Branches
Tags
No related merge requests found
...@@ -40,9 +40,12 @@ if [[ -z $SLURM_CPUS_ON_NODE ]] ...@@ -40,9 +40,12 @@ if [[ -z $SLURM_CPUS_ON_NODE ]]
then then
SLURM_CPUS_ON_NODE=1 SLURM_CPUS_ON_NODE=1
fi fi
diff $fq1 $fq2 > difffile.out
if [ $algo == 'star' ] if [ $algo == 'star' ]
then then
if ($fq1 != $fq2) if (-s difffile)
then then
module load star/2.4.2a module load star/2.4.2a
STAR --genomeDir ${index_path}/star_index/ --readFilesIn $fq1 $fq2 --readFilesCommand zcat --genomeLoad NoSharedMemory --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04 --outFilterMultimapNmax 20 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1 --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000 --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix out STAR --genomeDir ${index_path}/star_index/ --readFilesIn $fq1 $fq2 --readFilesCommand zcat --genomeLoad NoSharedMemory --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04 --outFilterMultimapNmax 20 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1 --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000 --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix out
...@@ -53,11 +56,11 @@ then ...@@ -53,11 +56,11 @@ then
mv outAligned.sortedByCoord.out.bam output.bam mv outAligned.sortedByCoord.out.bam output.bam
else else
module load hisat2/2.1.0-intel module load hisat2/2.1.0-intel
if [ $fq1 == $fq2 ] if [ -s difffile ]
then then
hisat2 -p $SLURM_CPUS_ON_NODE --rg-id ${pair_id} --rg LB:tx --rg PL:illumina --rg PU:barcode --rg SM:${pair_id} --add-chrname --no-unal --dta -x ${index_path}/hisat_index/genome -U $fq1 -S out.sam --summary-file ${pair_id}.alignerout.txt
else
hisat2 -p $SLURM_CPUS_ON_NODE --rg-id ${pair_id} --rg LB:tx --rg PL:illumina --rg PU:barcode --rg SM:${pair_id} --add-chrname --no-unal --dta -x ${index_path}/hisat_index/genome -1 $fq1 -2 $fq2 -S out.sam --summary-file ${pair_id}.alignerout.txt hisat2 -p $SLURM_CPUS_ON_NODE --rg-id ${pair_id} --rg LB:tx --rg PL:illumina --rg PU:barcode --rg SM:${pair_id} --add-chrname --no-unal --dta -x ${index_path}/hisat_index/genome -1 $fq1 -2 $fq2 -S out.sam --summary-file ${pair_id}.alignerout.txt
else
hisat2 -p $SLURM_CPUS_ON_NODE --rg-id ${pair_id} --rg LB:tx --rg PL:illumina --rg PU:barcode --rg SM:${pair_id} --add-chrname --no-unal --dta -x ${index_path}/hisat_index/genome -U $fq1 -S out.sam --summary-file ${pair_id}.alignerout.txt
fi fi
samtools view -1 --threads $SLURM_CPUS_ON_NODE -o output.bam out.sam samtools view -1 --threads $SLURM_CPUS_ON_NODE -o output.bam out.sam
fi fi
......
...@@ -32,13 +32,13 @@ r2base="${fq2%.fastq*}" ...@@ -32,13 +32,13 @@ r2base="${fq2%.fastq*}"
source /etc/profile.d/modules.sh source /etc/profile.d/modules.sh
module load trimgalore/0.4.1 cutadapt/1.9.1 module load trimgalore/0.4.1 cutadapt/1.9.1
if [ $fq1 == $fq2 ] if [ -s $fq2 ]
then then
trim_galore -q 25 --illumina --gzip --length 35 ${fq1}
mv ${r1base}_trimmed.fq.gz ${pair_id}.trim.R1.fastq.gz
cp ${pair_id}.trim.R1.fastq.gz ${pair_id}.trim.R2.fastq.gz
else
trim_galore --paired -q 25 --illumina --gzip --length 35 ${fq1} ${fq2} trim_galore --paired -q 25 --illumina --gzip --length 35 ${fq1} ${fq2}
mv ${r1base}_val_1.fq.gz ${pair_id}.trim.R1.fastq.gz mv ${r1base}_val_1.fq.gz ${pair_id}.trim.R1.fastq.gz
mv ${r2base}_val_2.fq.gz ${pair_id}.trim.R2.fastq.gz mv ${r2base}_val_2.fq.gz ${pair_id}.trim.R2.fastq.gz
else
trim_galore -q 25 --illumina --gzip --length 35 ${fq1}
mv ${r1base}_trimmed.fq.gz ${pair_id}.trim.R1.fastq.gz
cp ${pair_id}.trim.R1.fastq.gz ${pair_id}.trim.R2.fastq.gz
fi fi
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment