Created
June 17, 2015 15:20
-
-
Save asalt/ce7b01e06691805bc747 to your computer and use it in GitHub Desktop.
Count and use uniques
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
# construct counter to count the number of occurances of each fasta | |
cnt = Counter() | |
with inputfile as f: | |
for line in f: | |
linesplit = line.split('\t') | |
cnt[linesplit[fasta_pos]] += 1 #establish counter, count occurrances of each fasta file | |
with inputfile as f: | |
for line in f: | |
linesplit = line.split('\t') | |
if cnt[linesplit[fasta_pos]] == 1: #look at your counter, look at how many times the fasta occurs | |
outfile.write(......) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment