-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRandom_line_puller.pl
More file actions
33 lines (28 loc) · 1.11 KB
/
Random_line_puller.pl
File metadata and controls
33 lines (28 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/perl
use strict; use warnings;
my $PATH = "/Users/MCN/Documents/UConn/Genomes/Yersinia/Submission_Preparation/ENA_Validate/";
my $log = $PATH . "Log.txt";
# Pre-execution safety checking
if ( ! @ARGV) {
die "Script aborted: Must supply an input fasta as a script variable!";
}
open (INFILE, "$ARGV[0]") or die "Cannot open input file\n";
my $thisline; # The current line that we're at in the file
my $line_number = 0; # Lets us know what line we're at
my $badlines = 0;
while ($thisline = <INFILE>) { # Begin reading in the input file, line by line
$thisline =~ s/\s+$//; # Remove any trailing whitespaces and end of line characters
$line_number++; # Increment line number by 1
my $length = length($thisline);
if ($thisline =~ /[A-Z]+[0-9]+/) {
if ($thisline =~ /locus_tag=/) {
next;
}
elsif ($thisline =~ /note=/) {
next;
}
$badlines++;
print "$line_number: $thisline\n";
}
}
print "\nThere are $badlines line left still to fix :(\n"