#!/usr/bin/perl -w my $seq; open (SEQ, "<$ARGV[0]"); open (REP, "<$ARGV[1]"); open (OUT, ">$ARGV[2]"); while (){ $seq = $_; while (){ print OUT if /$seq/; } } close (SEQ); close (REP); close (OUT); #### SEQ: AELIVQPELK REP: 1 116.68 116.68 48.2199996709824 26.8999993801117 21.1799994111061 ENST00000379802_141 [201 - 8954] cdna:known chromosome:GRCh37:6:7541808:7586950:1 gene:ENSG00000096696 gene_biotype:protein_coding transcript_biotype:protein_coding 2 99.0000009536743 AELIVQPELK -5.64623987884261E-05 1138.65991210938 570.3372 1138.65979003906 570.337158203125 2 14 2.1.1.3480.1 1 0.7224 -1 -1 #### #!/usr/bin/perl -w use strict; my (@seq, @rep, $i, $n, $l, $t); open (SEQ, "<$ARGV[0]"); open (REP, "<$ARGV[1]"); open (OUT, ">$ARGV[2]"); $i=0; $n=0; $l=0; while (){ chomp(); $seq[$i] = $_; $i++; } while (){ $rep[$n] = $_; $n++; } while ($l < $i){ $t=0; while ($t < $n){ print OUT $rep[$t] if $rep[$t] =~ /$seq[$l]/; $t++; } $l++; } close (SEQ); close (REP); close (OUT);