I would like that NC_008934.1
is my key and Glypta fumiferanae ichnovirus segment B18, complete sequence
is my value`. Unfortunately, the below code is not working
UPDATE:
from subprocess import Popen, PIPE
p = Popen(
["find . -name \"*.fna\" -exec grep \">\" '{}' \; | cut -d '|' -f 4,5"],
stdout=PIPE,
stderr=PIPE)
result, err = p.communicate()
if p.returncode != 0:
raise IOError(err)
names = result.strip()
#names has many of this strings NC_008934.1| Glypta fumiferanae ichnovirus segment B18, complete sequence
names_dict = {n[0] : n[1] for n in (nameline.split("|") for nameline in namelines)}
print "!!!", names_dict
Error
python mapped_ids_names.py
Traceback (most recent call last):
File "mapped_ids_names.py", line 6, in <module>
stderr=PIPE)
File "/work/water/miniconda2/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/work/water/miniconda2/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
What did I miss?