Commit fe318735 authored by sdparekh's avatar sdparekh
Browse files

fixed a bug in indrops mode

parent 5f7e2ae1
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ if(@ARGV != 13)
{
print
"\n#####################################################################################
Usage: perl $0 <cDNA-read.fq.gz> <cellbarcode1-Read.fq.gz> <librarybarcode-Read.fq.gz> <cellbarcode2-Read.fq.gz> <nBase_BC_threshold> <BC_Qual_threshold> <nBase_umi_threshold> <UMI_Qual_threshold> <UMI_range> <Threads> <StudyName> <Outdir> <pigz-executable> \n
Usage: perl $0 <cDNA-read.fq.gz> <cellbarcode1-Read.fq.gz> <librarybarcode-Read.fq.gz> <cellbarcode2-Read.fq.gz> <nBase_BC_threshold> <BC_Qual_threshold> <nBase_umi_threshold> <UMI_Qual_threshold> <UMI_range> <Threads> <StudyName> <Outdir> <pigz-executable> <BC_range>\n
Explanation of parameter:

cDNA-Read.fq.gz		- Input fastq file with cDNA reads.
@@ -20,7 +20,8 @@ nBase_BC_threshold - Cell barcodes with number of bases under the base quality i
BC_Qual_threshold	- Minimum base quality required for the cell barcode to be accepted.(e.g. 20)
nBase_umi_threshold	- Molecular(UMI) barcodes with number of bases under the base quality is filtered out. (e.g. 1)
UMI_Qual_threshold	- Minimum base quality required for the molecule(umi) barcode to be accepted.(e.g. 20)
UMI_range		- Base range for UMI barcode in -f Barcode read (e.g. 1-6).
UMI_range		- Base range for UMI barcode (e.g. 1-6).
BC_range		- Base range for cell barcode (e.g. 1-22).

Threads			- Number of threads to use for zipping.
Study      		- Study name.
@@ -43,12 +44,20 @@ $bqualthreshold=$ARGV[5];
$mnbases=$ARGV[6];
$mqualthreshold=$ARGV[7];
$mcrange=$ARGV[8];
$bcrange=$ARGV[13];

$threads=$ARGV[9];
$study=$ARGV[10];
$outdir=$ARGV[11];
$pigz=$ARGV[12];

@b = split("-",$bcrange);
@m = split("-",$mcrange);
$bs = $b[0] - 1;
$ms = $m[0] - 1;
$bl = $b[1]-$b[0]+1;
$ml = $m[1]-$m[0]+1;

$bcreadout = $outdir."/".$study.".barcodelist.filtered.sam";
$bcreadoutfull = $outdir."/".$study.".barcoderead.filtered.fastq";
$cdnareadout = $outdir."/".$study.".cdnaread.filtered.fastq";
@@ -122,10 +131,10 @@ $total++;
		if(grep {$_ > 74} @quals){$offset=64;}else{$offset=33;}
	}

	$bseq = substr($seq,0,22);
	$mseq = substr($seq,22,6);
	$bqual = substr($qseq,0,22);
	$mqual = substr($qseq,22,6);
	$bseq = substr($seq,$bs,$bl);
	$mseq = substr($seq,$bl,$ml);
	$bqual = substr($qseq,$bs,$bl);
	$mqual = substr($qseq,$bl,$ml);

	@c = split(/\/|\s/,$crid);
	@b1 = split(/\/|\s/,$brid1);
+2 −1
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ cq="${11}"
t="${12}"
d="${13}"
pigz="${14}"
xc="${15}"

# MAKING THE HEADER
echo '#!/bin/bash' >$o/$sn.prep.sh
@@ -24,6 +25,6 @@ echo '#SBATCH --cpus-per-task='$t >>$o/$sn.prep.sh
echo '#SBATCH --workdir='$o >>$o/$sn.prep.sh
echo '#SBATCH --mem=1000' >>$o/$sn.prep.sh

echo "srun perl $d/fqfilter-inDrops.pl $f1 $f2 $f3 $f4 $cq $cbq $mq $mbq $xm $t $sn $o $pigz" >>$o/$sn.prep.sh
echo "srun perl $d/fqfilter-inDrops.pl $f1 $f2 $f3 $f4 $cq $cbq $mq $mbq $xm $t $sn $o $pigz $xc" >>$o/$sn.prep.sh

sbatch $o/$sn.prep.sh > $o/$sn.preparejobid.txt
+3 −3
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ Make sure you have 3-4 times more disk space to your input fastq files.
	-a  <GTF annotation>     : Path to GTF file. Required.
	-c  <XC baserange>       : Base range for cell/sample barcode in -f Barcode read(e.g. 1-6).  Required.
				   For STRT-seq give this as 1-n where n is your first cell barcode(-f) length.
				   For InDrops give this as 1-n where n is the total length of cell barcode(e.g. 1-22).
				   For InDrops give this as 1-n where n is the total length of cell barcode (8bp BC part1 + 6bp library barcode + 8bp BC part2) (e.g. 1-22).
	-m  <XM baserange>       : Base range for UMI barcode in -f Barcode read(e.g. 7-16).  Required.
				   For STRT-seq/InDrops give this as 1-n where n is your UMI length.
	-l  <readlength>         : Read length of -r cDNA reads (e.g. 50).  Required.
@@ -357,7 +357,7 @@ if [[ "$isslurm" == "yes" ]] ; then
		if [[ "$isstrt" == "yes" ]] ; then
			bash $zumisdir/zUMIs-filtering-strt.sh $cdnaread $bcread $sname $outdir $xmrange $cbasequal $mbasequal $molbcbase $cellbcbase $threads $zumisdir $bcread2 $BaseTrim $pigzexc
		elif [[ "$isindrops" == "yes" ]] ; then
			bash $zumisdir/zUMIs-filtering-inDrops.sh $cdnaread $bcread $libread $bcread2 $sname $outdir $xmrange $cbasequal $mbasequal $molbcbase $cellbcbase $threads $zumisdir $pigzexc
			bash $zumisdir/zUMIs-filtering-inDrops.sh $cdnaread $bcread $libread $bcread2 $sname $outdir $xmrange $cbasequal $mbasequal $molbcbase $cellbcbase $threads $zumisdir $pigzexc $xcrange
		else
			bash $zumisdir/zUMIs-filtering.sh $bcread $cdnaread $sname $outdir $xcrange $xmrange $cbasequal $mbasequal $molbcbase $cellbcbase $threads $zumisdir $pigzexc $pbcfastq $pbcrange
		fi
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ re='^[0-9]+$'
			if [[ "$isstrt" == "yes" ]] ; then
				perl $zumisdir/fqfilter-strt.pl $f1 $f2 $f3 $cq $cbq $mq $mbq $xm $bt $t $sn $o $pigzexc
			elif [[ "$isindrops" == "yes" ]] ; then
				perl $zumisdir/fqfilter-inDrops.pl $f1 $f2 $libread $f3 $cq $cbq $mq $mbq $xm $t $sn $o $pigzexc
				perl $zumisdir/fqfilter-inDrops.pl $f1 $f2 $libread $f3 $cq $cbq $mq $mbq $xm $t $sn $o $pigzexc $xc
			else
				perl $zumisdir/fqfilter.pl $f2 $f1 $pbcfastq $cq $cbq $mq $mbq $xc $pbcrange $xm $t $sn $o $pigzexc
			fi