Mercurial > repos > dfornika > match_plasmid_to_reference
diff match_plasmid_to_reference.py @ 1:3616b6eda1da draft
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/match_plasmid_to_reference commit dcdac86bce5c44043516fbd472ab7c19d7bf4d50-dirty"
author | dfornika |
---|---|
date | Wed, 06 Nov 2019 00:42:05 -0500 |
parents | 8bb674372911 |
children | 826ddf832bef |
line wrap: on
line diff
--- a/match_plasmid_to_reference.py Wed Nov 06 00:08:43 2019 -0500 +++ b/match_plasmid_to_reference.py Wed Nov 06 00:42:05 2019 -0500 @@ -65,18 +65,22 @@ if line.startswith('ACCESSION'): return line.strip().split()[1] - def count_contigs(plasmid_fasta_path): contigs = 0 with open(plasmid_fasta_path, 'r') as f: - contigs = 2 + for line in f: + if line.startswith('>'): + contigs += 1 return contigs def count_bases(plasmid_fasta_path): bases = 0 with open(plasmid_fasta_path, 'r') as f: - bases = 11117 + for line in f: + line = line.strip() + if not line.startswith('>'): + bases += len(line) return bases def main(args):