Quality columns are now optional in NUC_SEQS views + minor fixes
This commit is contained in:
@ -42,8 +42,6 @@ def addOptions(parser):
|
||||
type=str,
|
||||
required=True,
|
||||
help="Name of the default DMS for reading and writing data")
|
||||
|
||||
group=parser.add_argument_group('obi import specific options')
|
||||
|
||||
group.add_argument('--skip',
|
||||
action="store", dest="import:skip",
|
||||
@ -88,10 +86,11 @@ def addOptions(parser):
|
||||
const='pep',
|
||||
help="Input file contains protein sequences")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# TODO: Handling of NA values
|
||||
def run(config):
|
||||
pb = ProgressBar(35000000,config,seconde=5)
|
||||
#pb = ProgressBar(35000000, config, seconde=5)
|
||||
|
||||
inputs = uopen(config['import']['filename'])
|
||||
|
||||
@ -105,35 +104,28 @@ def run(config):
|
||||
get_quality = True
|
||||
else:
|
||||
raise RuntimeError('No file format specified')
|
||||
|
||||
# Temporary way to handle NA values
|
||||
#NA_list = ["nan"]
|
||||
|
||||
|
||||
# Create DMS
|
||||
d = OBIDMS(config['obi']['defaultdms'])
|
||||
|
||||
# Create view
|
||||
view = d.new_view(config['import']['destview'], view_type=view_type)
|
||||
view = d.new_view(config['import']['destview'], view_type=view_type, quality_column=get_quality)
|
||||
|
||||
i = 0
|
||||
for seq in iseq:
|
||||
pb(i)
|
||||
#pb(i)
|
||||
view[i].set_id(seq['id'])
|
||||
view[i].set_definition(seq['definition'])
|
||||
view[i].set_sequence(seq['sequence'])
|
||||
if get_quality :
|
||||
view[i].set_quality(seq['quality'])
|
||||
for tag in seq['tags'] :
|
||||
#print(tag, seq['tags'][tag])
|
||||
#if seq['tags'][tag] not in NA_list :
|
||||
view[i][tag] = seq['tags'][tag]
|
||||
i+=1
|
||||
|
||||
#print(i)
|
||||
print(view.__repr__())
|
||||
|
||||
view.save_and_close()
|
||||
view.save_and_close()
|
||||
d.close()
|
||||
|
||||
print("Done.")
|
||||
|
Reference in New Issue
Block a user