#!/usr/bin/perl -w use File::Basename; $szUsage = "filter454Reads.perl (fasta file of 454 reads) (linker fasta) (puc19 fasta) (cross_match output file for linker) (cross_match output for puc19)"; if ( $#ARGV >= 0 ) { if ( lc( $ARGV[0]) eq "-v" ) { print "081028\n"; exit(0); } } if ( $#ARGV != 4 ) { die "usage: $szUsage\n"; } $sz454Reads = $ARGV[0]; $szLinker = $ARGV[1]; $szPuc = $ARGV[2]; $szLinkerOutput = $ARGV[3]; $szPucOutput = $ARGV[4]; defined( $szConsedHome = $ENV{'CONSED_HOME'} ) || ( $szConsedHome = "/usr/local/genome" ); if ( !-r $szConsedHome ) { die "Could not find $szConsedHome for the root of the consed programs. Is the environment variable CONSED_HOME set correctly?"; } $szCrossMatch = $szConsedHome . "/bin/cross_match"; if ( -e "$szLinkerOutput" ) { unlink( $szLinkerOutput ); } if ( -e "$szPucOutput" ) { unlink( $szPucOutput ); } # warning--$sz454Reads must come before $szLinker $szCommand = "$szCrossMatch -tags -minscore 16 $sz454Reads $szLinker >$szLinkerOutput"; !system( $szCommand ) || die "couldn't execute $szCommand"; # $szPuc may be in a write-only directory. So copy it to your local directory $szPucBasename = basename( $szPuc ); $szCommand = "cp $szPuc $szPucBasename"; !system( $szCommand ) || die "couldn't execute $szCommand"; # warning $szPuc must come before $sz454Reads $szCommand = "$szCrossMatch -masklevel 101 -tags $szPucBasename $sz454Reads >$szPucOutput"; !system( $szCommand ) || die "couldn't execute $szCommand"; # these can be commented-out for troubleshooting unlink( $sz454Reads ); unlink( $szPucBasename ); unlink( $szPucBasename . ".log" );