diff rapsodyn/filtersam_mapped_and_unique.pl @ 0:442a7c88b886 draft

Uploaded
author mcharles
date Wed, 10 Sep 2014 09:18:15 -0400
parents
children 3f7b0788a1c4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rapsodyn/filtersam_mapped_and_unique.pl	Wed Sep 10 09:18:15 2014 -0400
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+open(IN, $ARGV[0]) or die ("Can't open $ARGV[0]\n");
+while (my $line=<IN>){
+	if ($line =~ /^\@/){
+		#Header conservation
+		print $line;
+	}
+	else {
+		#Optionnal flag verification
+		if (($line =~ /XT\:A\:U/)&&($line =~ /X0\:i\:1/)&&($line =~ /X1\:i\:0\s/)){
+			my @fields = split (/\s+/,$line);
+			if (($fields[1]==83)||($fields[1]==163)||($fields[1]==147)||($fields[1]==99)){
+				print $line;
+			}
+		}
+	}
+}
+
+
+close (IN);
\ No newline at end of file