skip to main content
Roche logo
#!/usr/bin/perl
if ($ARGV[0] =~ /^(\w*)\.([rf])1$/) {
   print "template=$1 dir=$2 library=pairlib\n";
}
where "$ARGV[0]" will be the accession number for the read, when used in the procedure below.
The regular expression in this script states “^(\w*)\.([rf])1$” matches a word of any length, “\w*”, followed by a period, “\.”, followed by either an ‘r’ or an ‘f’, followed by a ‘1’. The parentheses are there to then extract the characters that matched the word and matched the ‘r’ or ‘f’ and place them into the “$1” and “$2” parameters (so that they can be used in the print statement on the next line). For a local naming convention, customize the Perl regular expression to extract out the template, library and forward/reverse direction strings from the accession, and output them appropriately (see Section 4.13.3) for a description of this output.
#!/usr/bin/perl
die "Usage: detPairs screenfile\n" unless defined($ARGV[0]); open(FILE, 
$ARGV[0]) or die "Error: Unable to open file: $ARGV[0]\n";
while (<FILE>) {
    if (/^\>(\S*)/) {
        my $accno = $1;
        if ($accno =~ /^(\w*)\.([rf])1$/) {
            print "$accno template=$1 dir=$2 library=pairlib\n";
        }
    }
}
For both of these scripts, see Section 3.4 for a description of the command line structure and arguments of fnafile.