Commit 0fdccd2d authored by ziegenhain@bio.lmu.de's avatar ziegenhain@bio.lmu.de
Browse files

Allow custom R and pigz locations

parent 16d38403
Loading
Loading
Loading
Loading
(153 KiB)

File mode changed from 100644 to 100755.

+23 −21
Original line number Diff line number Diff line
@@ -4,11 +4,11 @@
# Author: Swati Parekh
# Contact: parekh@bio.lmu.de or ziegenhain@bio.lmu.de or hellmann@bio.lmu.de

if(@ARGV != 12)
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> \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
Explanation of parameter:

cDNA-Read.fq.gz		- Input fastq file with cDNA reads.
@@ -26,6 +26,8 @@ Threads - Number of threads to use for zipping.
Study      		- Study name.
OUTDIR      		- Output directory.

pigz-executable - Location of pigz executable

Please drop your suggestions and clarifications to <parekh\@bio.lmu.de>\n
######################################################################################\n\n";
exit;
@@ -45,16 +47,17 @@ $mcrange=$ARGV[8];
$threads=$ARGV[9];
$study=$ARGV[10];
$outdir=$ARGV[11];
$pigz=$ARGV[12];

$bcreadout = $outdir."/".$study.".barcodelist.filtered.sam";
$bcreadoutfull = $outdir."/".$study.".barcoderead.filtered.fastq";
$cdnareadout = $outdir."/".$study.".cdnaread.filtered.fastq";

if ($cdnaread =~ /\.gz$/) {
open BCF1, '-|', 'pigz', '-dc', $fgelread || die "Couldn't open file $fgelread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
open BCF2, '-|', 'pigz', '-dc', $sgelread || die "Couldn't open file $sgelread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
open LDF, '-|', 'pigz', '-dc', $libread || die "Couldn't open file $libread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
open CDF, '-|', 'pigz', '-dc', $cdnaread || die "Couldn't open file $cdnaread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
open BCF1, '-|', $pigz, '-dc', $fgelread || die "Couldn't open file $fgelread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
open BCF2, '-|', $pigz, '-dc', $sgelread || die "Couldn't open file $sgelread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
open LDF, '-|', $pigz, '-dc', $libread || die "Couldn't open file $libread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
open CDF, '-|', $pigz, '-dc', $cdnaread || die "Couldn't open file $cdnaread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
}
else {
open BCF1, "<", $fgelread || die "Couldn't open file $fgelread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
@@ -159,6 +162,5 @@ close BCOUTFULL;

print "Raw reads: $total \nFiltered reads: $filtered \n\n";

`pigz -f -p $threads $cdnareadout`;
`pigz -f -p $threads $bcreadoutfull`;
`$pigz -f -p $threads $cdnareadout`;
`$pigz -f -p $threads $bcreadoutfull`;
+20 −18
Original line number Diff line number Diff line
@@ -5,11 +5,11 @@
# Contact: parekh@bio.lmu.de or ziegenhain@bio.lmu.de or hellmann@bio.lmu.de


if(@ARGV != 12)
if(@ARGV != 13)
{
print
"\n#####################################################################################
Usage: perl $0 <umicdna-Read.fq.gz> <cellbarcode1-Read.fq.gz> <cellbarcode2-Read.fq.gz> <cellbc_threshold> <Cellbc_Qual_threshold> <umi_threshold> <UMIbc_Qual_threshold> <UMI_range> <BasesToTrim> <Threads> <StudyName> <Outdir> \n
Usage: perl $0 <umicdna-Read.fq.gz> <cellbarcode1-Read.fq.gz> <cellbarcode2-Read.fq.gz> <cellbc_threshold> <Cellbc_Qual_threshold> <umi_threshold> <UMIbc_Qual_threshold> <UMI_range> <BasesToTrim> <Threads> <StudyName> <Outdir> <pigz-executable> \n
Explanation of parameter:

umicDNA-Read.fq.gz	- Input fastq file with UMI and cDNA reads.
@@ -25,6 +25,7 @@ bases to trim - Number of bases to trim between UMI and cDNA read (e.g. 3).
Threads			- Number of threads to use.
Study       - Study name.
OUTDIR      - Output directory.
pigz-executable - Location of pigz executable
Please drop your suggestions and clarifications to <parekh\@bio.lmu.de>\n
######################################################################################\n\n";
exit;
@@ -41,6 +42,7 @@ $btrim=$ARGV[8];
$threads=$ARGV[9];
$study=$ARGV[10];
$outdir=$ARGV[11];
$pigz=$ARGV[12];

@m = split("-",$mcrange);
$ms = $m[0] - 1;
@@ -54,8 +56,8 @@ $umicdnareadout = $outdir."/".$study.".umicdnaread.filtered.fastq";

if($bcread2 eq "NA"){
	if ($bcread1 =~ /\.gz$/) {
	open BCF1, '-|', 'pigz', '-dc', $bcread1 || die "Couldn't open file $bcread1. Check permissions!\n Check if it is differently zipped then .gz\n\n";
	open CDF, '-|', 'pigz', '-dc', $umicdnaread || die "Couldn't open file $umicdnaread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
	open BCF1, '-|', $pigz, '-dc', $bcread1 || die "Couldn't open file $bcread1. Check permissions!\n Check if it is differently zipped then .gz\n\n";
	open CDF, '-|', $pigz, '-dc', $umicdnaread || die "Couldn't open file $umicdnaread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
	}
	else {
	open BCF1, "<", $bcread1 || die "Couldn't open file $bcread1. Check permissions!\n Check if it is differently zipped then .gz\n\n";
@@ -64,9 +66,9 @@ if($bcread2 eq "NA"){
}
else{
	if ($bcread1 =~ /\.gz$/) {
	open BCF1, '-|', 'pigz', '-dc', $bcread1 || die "Couldn't open file $bcread1. Check permissions!\n Check if it is differently zipped then .gz\n\n";
	open BCF2, '-|', 'pigz', '-dc', $bcread2 || die "Couldn't open file $bcread2. Check permissions!\n Check if it is differently zipped then .gz\n\n";
	open CDF, '-|', 'pigz', '-dc', $umicdnaread || die "Couldn't open file $umicdnaread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
	open BCF1, '-|', $pigz, '-dc', $bcread1 || die "Couldn't open file $bcread1. Check permissions!\n Check if it is differently zipped then .gz\n\n";
	open BCF2, '-|', $pigz, '-dc', $bcread2 || die "Couldn't open file $bcread2. Check permissions!\n Check if it is differently zipped then .gz\n\n";
	open CDF, '-|', $pigz, '-dc', $umicdnaread || die "Couldn't open file $umicdnaread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
	}
	else {
	open BCF1, "<", $bcread1 || die "Couldn't open file $bcread1. Check permissions!\n Check if it is differently zipped then .gz\n\n";
@@ -168,7 +170,7 @@ close UMIOUTFULL;

print "Raw reads: $total \nFiltered reads: $filtered \n\n";

`pigz -f -p $threads $cdnareadout`;
`pigz -f -p $threads $bcreadoutfull`;
if($bcread2 ne "NA"){`pigz -f -p $threads $bcreadoutfull2`;}
`pigz -f -p $threads $umicdnareadout`;
`$pigz -f -p $threads $cdnareadout`;
`$pigz -f -p $threads $bcreadoutfull`;
if($bcread2 ne "NA"){`$pigz -f -p $threads $bcreadoutfull2`;}
`$pigz -f -p $threads $umicdnareadout`;
+12 −10
Original line number Diff line number Diff line
@@ -4,11 +4,11 @@
# Author: Swati Parekh
# Contact: parekh@bio.lmu.de or ziegenhain@bio.lmu.de or hellmann@bio.lmu.de

if(@ARGV != 11)
if(@ARGV != 12)
{
print
"\n#####################################################################################
Usage: perl $0 <barcode-Read.fq.gz> <cDNA-Read.fq.gz> <cellbc_threshold> <Cellbc_Qual_threshold> <umi_threshold> <UMIbc_Qual_threshold> <Cellbc_range> <UMI_range> <Threads> <StudyName> <Outdir> \n
Usage: perl $0 <barcode-Read.fq.gz> <cDNA-Read.fq.gz> <cellbc_threshold> <Cellbc_Qual_threshold> <umi_threshold> <UMIbc_Qual_threshold> <Cellbc_range> <UMI_range> <Threads> <StudyName> <Outdir> <pigz-executable> \n
Explanation of parameter:

barcode-Read.fq.gz	- Input barcode reads fastq file name.
@@ -22,6 +22,7 @@ UMI_range - Base range for UMI barcode in -f Barcode read(e.g. 7-16).
Threads			- Number of threads to use.
Study       - Study name.
OUTDIR      - Output directory.
pigz-executable - Location of pigz executable
Please drop your suggestions and clarifications to <parekh\@bio.lmu.de>\n
######################################################################################\n\n";
exit;
@@ -38,6 +39,7 @@ $mcrange=$ARGV[7];
$threads=$ARGV[8];
$study=$ARGV[9];
$outdir=$ARGV[10];
$pigz=$ARGV[11];

@b = split("-",$bcrange);
@m = split("-",$mcrange);
@@ -51,8 +53,8 @@ $bcreadoutfull = $outdir."/".$study.".barcoderead.filtered.fastq";
$cdnareadout = $outdir."/".$study.".cdnaread.filtered.fastq";

if ($bcread =~ /\.gz$/) {
open BCF, '-|', 'gzip', '-dc', $bcread || die "Couldn't open file $bcread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
open CDF, '-|', 'gzip', '-dc', $cdnaread || die "Couldn't open file $cdnaread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
open BCF, '-|', $pigz, '-dc', $bcread || die "Couldn't open file $bcread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
open CDF, '-|', $pigz, '-dc', $cdnaread || die "Couldn't open file $cdnaread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
}
else {
open BCF, "<", $bcread || die "Couldn't open file $bcread. Check permissions!\n Check if it is differently zipped then .gz\n\n";
@@ -119,5 +121,5 @@ close BCOUTFULL;

print "Raw reads: $total \nFiltered reads: $filtered \n\n";

`pigz -f -p $threads $cdnareadout`;
`pigz -f -p $threads $bcreadoutfull`;
`$pigz -f -p $threads $cdnareadout`;
`$pigz -f -p $threads $bcreadoutfull`;
+5 −4
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ isstrt="${13}"
f3="${14}"
xc2="${15}"
nreads="${16}"
Rexc="${17}"

j=`cat $o/$sn.mapjobid.txt | cut -f4 -d' '`
u=`cat $o/$sn.unmapjobid.txt | cut -f4 -d' '`
@@ -51,17 +52,17 @@ echo "ln -s -f $o/$sn.aligned.sorted.bam $o/$sn.aligned.sorted.bam.ex" >>$o/$sn.

if [[ "$whichStage" != "summarising" ]] ; then
	if [[ $n =~ $re ]] ; then
		echo "srun --chdir=$o Rscript $d/zUMIs-dge.R --gtf $g --abam $o/$sn.aligned.sorted.bam --ubam $o/$sn.barcodelist.filtered.sort.sam --barcodenumber $n --out $o --sn $sn --cores $t --strandedness $s --bcstart $xcst --bcend $xcend --umistart $xmst --umiend $xmend --subsamp $subs --nReadsBC $nreads" >>$o/$sn.dge.sh
		echo "srun --chdir=$o $Rexc $d/zUMIs-dge.R --gtf $g --abam $o/$sn.aligned.sorted.bam --ubam $o/$sn.barcodelist.filtered.sort.sam --barcodenumber $n --out $o --sn $sn --cores $t --strandedness $s --bcstart $xcst --bcend $xcend --umistart $xmst --umiend $xmend --subsamp $subs --nReadsBC $nreads" >>$o/$sn.dge.sh
	else
		echo "srun --chdir=$o Rscript $d/zUMIs-dge.R --gtf $g --abam $o/$sn.aligned.sorted.bam --ubam $o/$sn.barcodelist.filtered.sort.sam --barcodefile $n --out $o --sn $sn --cores $t --strandedness $s --bcstart $xcst --bcend $xcend --umistart $xmst --umiend $xmend --subsamp $subs --nReadsBC $nreads" >>$o/$sn.dge.sh
		echo "srun --chdir=$o $Rexc $d/zUMIs-dge.R --gtf $g --abam $o/$sn.aligned.sorted.bam --ubam $o/$sn.barcodelist.filtered.sort.sam --barcodefile $n --out $o --sn $sn --cores $t --strandedness $s --bcstart $xcst --bcend $xcend --umistart $xmst --umiend $xmend --subsamp $subs --nReadsBC $nreads" >>$o/$sn.dge.sh
	fi

	if [[ $stats == "yes" ]] ; then
		echo "srun --chdir=$o Rscript $d/zUMIs-stats.R --out $o --sn $sn" >>$o/$sn.dge.sh
		echo "srun --chdir=$o $Rexc $d/zUMIs-stats.R --out $o --sn $sn" >>$o/$sn.dge.sh
	fi
else
	if [[ $stats == "yes" ]] ; then
		echo "srun --chdir=$o Rscript $d/zUMIs-stats.R --out $o --sn $sn" >>$o/$sn.dge.sh
		echo "srun --chdir=$o $Rexc $d/zUMIs-stats.R --out $o --sn $sn" >>$o/$sn.dge.sh
	else
		echo "You need to switch on -S <isStats> option."
	fi
Loading