Comments (4)
Hi Sarah
Last night I had the same problem when I was trying to set up a virulence gene database for Salmonella. And I got an identical error message. Have you found a solution to the issue?
Many thanks,
Yue
from srst2.
Hi @aphayt,
I was able to make the program work by modifying the "main" function of VFDB_cdhit_to_csv.py with the following code:
def main():
args = parse_args()
outfile = file(args.outfile,"w")
outfile.write("seqID,clusterid,gene,allele,DNA,annotation\n")
database = {} # key = clusterid, value = list of seqIDs
seq2cluster = {} # key = seqID, value = clusterid
for line in open(args.cluster_file):
if line.startswith(">"):
ClusterNr = line.split()[1]
continue
line_split = line.split(">")
seqID = line_split[1].split("(")[0]
if ClusterNr not in database:
database[ClusterNr] = []
if seqID not in database[ClusterNr]:
database[ClusterNr].append(seqID) # for virulence gene DB, this is the unique ID R0xxx
seq2cluster[seqID] = ClusterNr
for record in SeqIO.parse(open(args.infile, "r"), "fasta"):
clusterid = ""
full_name = record.description
genus = full_name.split("[")[2].split()[0]
id_bits = re.sub("[()]","",full_name.split("[")[0]).split() # 'R004852 fliL VP2243 '
seqID = full_name.split()[0].split("(")[0] # R004852
gene = id_bits[1] # fliL
if len(id_bits) > 2:
allele = id_bits[1]+"_"+id_bits[2] # fliL_VP2243
else:
allele = id_bits[1]
if seqID in seq2cluster:
clusterid = seq2cluster[seqID]
outstring = ",".join([seqID, clusterid, gene, allele, str(record.seq), re.sub(",","",record.description)]) + "\n"
outfile.write(outstring)
outfile.close()
Hope this helps,
Sarah P.
from srst2.
Hi Sarah
Many thanks for sharing. I have made two VF databases: Campylobacter and Salmonella after following the steps in 'Error in step: Using the VFDB Virulence Factor Database with SRST2' #59.
Best,
Yue
from srst2.
Fixed in 5b1639b - thanks!
from srst2.
Related Issues (20)
- Please port to Python3 HOT 2
- Same output entries from db HOT 1
- VFDB cannot be executed from the middle.
- Using srst2 for metagenomic screening HOT 1
- databases not updated HOT 1
- Different naming from Resfinder CGE db HOT 3
- Clustering CARD database HOT 4
- password request HOT 1
- Gene typing gene results contain last hit of the list and not the best hit
- "ecoli.txt" HOT 1
- srst2_and_bowtie2 HOT 1
- Neisseria Gonorrhoeae
- output
- urllib2.URLError:
- SyntaxError when running srst2 HOT 1
- Indel variation in reference alleles lead to sporadic ST miscalls for S. aureus
- confusing or incorrect scoring leads to mis-called allele
- Error in output when a gene contains a parentheses
- Github and Conda version inconsistencies
- custom databases - manual intervention required to complete code for sequence reads
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from srst2.