Skip to content

Commit

Permalink
Issue #2 - use ? for novel alleles
Browse files Browse the repository at this point in the history
  • Loading branch information
tseemann committed Feb 26, 2020
1 parent 081a8bc commit da2715a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ script:
- "! (legsta --quiet test/NC_006368.fna |& grep Loaded)"
- "legsta /dev/null 2>&1 | grep ERROR"
- legsta test/CR628336.1.gbk.gz | grep -P "1\t1\t4\t3\t1\t1\t1\t1"
- legsta test/FJBS01000000.fna.bz2 | grep -F '?'
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,20 @@ The files may also be compressed with gzip, bzip2 or zip.
## Output

Output is a TSV file (or CSV if `--csv` is used).
Alleles with no _in silico_ product are denoted `-`
and novel alleles listed using `?`.

```
% cd legsta/test
% ../bin/legsta NC_006368.fna NC_018140.fna CR628336.1.gbk.gz
% ../bin/legsta NC_006368.fna NC_018140.fna CR628336.1.gbk.gz missing_flaA.fna FJBS01000000.fna.bz2
FILE SBT flaA pilE asd mip mompS proA neuA
NC_006368.fna 1 1 4 3 1 1 1 1
NC_018140.fna 734 2 6 17 1 1 8 11
CR628336.1.gbk.gz 1 1 4 3 1 1 1 1
FILE SBT flaA pilE asd mip mompS proA neuA
NC_006368.fna 1 1 4 3 1 1 1 1
NC_018140.fna 734 2 6 17 1 1 8 11
CR628336.1.gbk.gz 1 1 4 3 1 1 1 1
missing_flaA.fna - - 14 16 25 7 13 206
FJBS01000000.fna.bz2 - 3 10 1 3 14 9 ?
```

Expand Down
8 changes: 6 additions & 2 deletions bin/legsta
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ use Cwd 'abs_path';
#..............................................................................
# Globals

my $VERSION = "0.5.0";
my $VERSION = "0.5.1";
my $URL = "https://github.com/tseemann/legsta";
my $OUTSEP = "\t";
my $ISPCR = "isPcr";
my $ISPCR_OPT = "-minPerfect=5 -tileSize=6 -maxSize=1200 -stepSize=5";
my $SEP = "/";
my $UNK = "-";
my $NOVEL = "?";

#..............................................................................
# Command line options
Expand Down Expand Up @@ -86,7 +87,7 @@ for my $fasta (@ARGV) {
# Determine the allele profile
my @profile;
for my $g (@gene) {
my $num = $UNK;
my $num = $NOVEL;
if (my $hit = $amp->{$g}) {
msg("Scanning $g database") if $debug;
# Look for exact substring matches in linear search (db is small)
Expand All @@ -97,6 +98,9 @@ for my $fasta (@ARGV) {
}
}
}
else {
$num = $UNK;
}
msg("Allele $g => $num") if $debug;
push @profile, $num;
}
Expand Down
Binary file added test/FJBS01000000.fna.bz2
Binary file not shown.

0 comments on commit da2715a

Please sign in to comment.