Added properties for Nuc_Seq cython classes (and updated commands using

them)
This commit is contained in:
Celine Mercier
2016-11-08 16:59:32 +01:00
parent b5b889c4a2
commit 51b23915ca
4 changed files with 89 additions and 90 deletions

View File

@ -67,16 +67,16 @@ def run(config):
for seq in iview :
pb(i)
toprint = ">"+seq.get_id()+" "
toprint = ">"+seq.id+" "
for col_name in seq :
if col_name not in special_columns :
toprint = toprint + col_name + "=" + str(seq[col_name]) + "; "
if DEFINITION_COLUMN in seq :
toprint = toprint + seq.get_definition()
toprint = toprint + seq.definition
nucseq = bytes2str(seq.get_sequence())
nucseq = bytes2str(seq.nuc_seq)
if config['export']['format'] == "fasta" :
nucseq = re.sub("(.{60})", "\\1\n", nucseq, 0, re.DOTALL)

View File

@ -90,7 +90,7 @@ def addOptions(parser):
# TODO: Handling of NA values
def run(config):
pb = ProgressBar(35000000, config, seconde=5)
pb = ProgressBar(10000, config, seconde=5) # TODO should be number of records in file
inputs = uopen(config['import']['filename'])
@ -107,25 +107,24 @@ def run(config):
# Create DMS
d = OBIDMS(config['obi']['defaultdms'])
# Create view
view = d.new_view(config['import']['destview'], view_type=view_type, quality_column=get_quality)
i = 0
for seq in iseq:
pb(i)
view[i].set_id(seq['id'])
view[i].set_definition(seq['definition'])
view[i].set_sequence(seq['sequence'])
view[i].id = seq['id']
view[i].definition = seq['definition']
view[i].nuc_seq = seq['sequence']
if get_quality :
view[i].set_quality(seq['quality'])
view[i].quality = seq['quality']
for tag in seq['tags'] :
view[i][tag] = seq['tags'][tag]
i+=1
print(view.__repr__())
#print(view.__repr__())
view.close()
d.close()
print("Done.")