Commit ae020e7d authored by TomKellyGenetics's avatar TomKellyGenetics
Browse files

pass arguments for tag and output for TSO and filtering scripts

parent bb757935
Loading
Loading
Loading
Loading

sub/AddMockUMI.pl

100644 → 100755
+127 −117
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ my $fastq_in = "";
my $fastq_out = "mock_UMI.fastq";
my $head_length = ""; #number of characters to have before insertion of mock UMI.
my $umi_length = ""; #length of desired UMI
my $out_dir = ".";
##########


@@ -31,7 +32,8 @@ my $umi_length = ""; #length of desired UMI
GetOptions (
	'fastq=s' => \$fastq_in,
	'head_length=s' => \$head_length,
	'umi_length=s' => \$umi_length
	'umi_length=s' => \$umi_length,
        'out_dir=s' => \$out_dir
	);

#checking for required options.
@@ -44,6 +46,14 @@ elsif (!$head_length) {
elsif (!$umi_length) {
	die "USAGE: option --umi_length <INTEGER> is required.\n";
}
elsif (!$out_dir) {
        die "USAGE: option --out_dir <OUTPUT_DIRECTORY> is required.\n";
}

$fastq_out = $out_dir."/".$fastq_out;
$fastq_out =~ s/\/\//\//;
##########


#checking head length
if ( $head_length !~ /^-?\d+\.?\d*$/ ) {
+0 −0

File mode changed from 100644 to 100755.

sub/FilterSmartSeqReadUMI.pl

100644 → 100755
+9 −8
Original line number Diff line number Diff line
@@ -19,17 +19,17 @@ use Getopt::Long;

#####Options#####
#SmartSeq3 tag
my $ss3t = "ATTGCGCAATG";
my $tagseq = "ATTGCGCAATG";

#setting the default values.
my $i1 = "";
my $i2 = "";
my $r1 = "";
my $r2 = "";
my $i1_out = "SmartSeq3_parsed_I1.fastq";
my $i2_out = "SmartSeq3_parsed_I2.fastq";
my $r1_out = "SmartSeq3_parsed_R1.fastq";
my $r2_out = "SmartSeq3_parsed_R2.fastq";
my $i1_out = "parsed_I1.fastq";
my $i2_out = "parsed_I2.fastq";
my $r1_out = "parsed_R1.fastq";
my $r2_out = "parsed_R2.fastq";
my $out_dir = "";

#making the options into external arguments.
@@ -38,6 +38,7 @@ GetOptions (
	'i2=s' => \$i2,
	'r1=s' => \$r1,
	'r2=s' => \$r2,
        'tag=s' => \$tagseq,
	'out_dir=s' => \$out_dir
	);

@@ -73,7 +74,7 @@ $r2_out =~ s/\/\//\//;

#####MAIN#####
#get list of reads to keep
my @keepreads = map { ($_ + 2) / 4 } split(/\n/, `grep $ss3t $r1 -n | cut -f1 -d\:`);
my @keepreads = map { ($_ + 2) / 4 } split(/\n/, `grep $tagseq $r1 -n | cut -f1 -d\:`);
my %keepreads = map { $_ => 1 } @keepreads;

#parse reads to keep
@@ -112,9 +113,9 @@ while (my $line = <R1>) {
	}
	else {
		#trim r1 data
		my @trim = split (/$ss3t/, $r1_seq);
		my @trim = split (/$tagseq/, $r1_seq);
		shift @trim;
		my $new_r1_seq = join ("$ss3t", @trim);
		my $new_r1_seq = join ("$tagseq", @trim);
		my $new_r1_q = $r1_q;
		chomp $new_r1_q;
		$new_r1_q = reverse $new_r1_q;

sub/RecoverBarcodes.pl

100644 → 100755
+0 −0

File mode changed from 100644 to 100755.

sub/cat_fastq.pl

100644 → 100755
+0 −0

File mode changed from 100644 to 100755.