From 1d84c9da96b47cf222d440640e344a42637795c9 Mon Sep 17 00:00:00 2001 From: depristo Date: Tue, 7 Jul 2009 16:42:40 +0000 Subject: [PATCH] sortByRef now supports x:y location syntax git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1186 348d0f76-0448-11de-a6fe-93d51630548a --- perl/sortByRef.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/perl/sortByRef.pl b/perl/sortByRef.pl index 7696be3ba..9077b0e2a 100755 --- a/perl/sortByRef.pl +++ b/perl/sortByRef.pl @@ -63,6 +63,11 @@ while ( ) { if ( $pos >= scalar(@fields) ); my $contig = $fields[$pos]; + if ( $contig =~ m/:/ ) { + my @loc = split(/:/, $contig); + # print $contig . " " . $loc[0] . "\n"; + $contig = $loc[0] + } chomp $contig if ( $pos == scalar(@fields) - 1 ); # if last field in line my $order; @@ -76,6 +81,7 @@ while ( ) { my $fhandle; if ( defined $temp_outputs{$order} ) { $fhandle = $temp_outputs{$order} } else { + #print "opening $order $$ $_\n"; open( $fhandle, " > /tmp/sortByRef.$$.$order.tmp" ) or die ( "Can not open temporary file $order: $!"); $temp_outputs{$order} = $fhandle;