minor comments and changes
This commit is contained in:
@ -30,16 +30,6 @@ def addOptions(parser):
|
||||
default=None,
|
||||
type=str,
|
||||
help="Name of the view.")
|
||||
|
||||
|
||||
# group=parser.add_argument_group('obi check specific options')
|
||||
|
||||
# group.add_argument('--print',
|
||||
# action="store", dest="less:print",
|
||||
# metavar='<N>',
|
||||
# default=None,
|
||||
# type=int,
|
||||
# help="Print N sequences (default: 10)")
|
||||
|
||||
|
||||
def run(config):
|
||||
@ -48,9 +38,9 @@ def run(config):
|
||||
d = DMS.open(config['obi']['defaultdms'])
|
||||
|
||||
# Open input view uif there is one
|
||||
if config['obi']['inputview'] is not None :
|
||||
iview = View.open(d, config['obi']['view'])
|
||||
print(repr(iview))
|
||||
if 'view' in config['obi'] :
|
||||
view = View.open(d, config['obi']['view'])
|
||||
print(repr(view))
|
||||
|
||||
else :
|
||||
for v in d :
|
||||
|
@ -1,3 +1,5 @@
|
||||
#cython: language_level=3
|
||||
|
||||
'''
|
||||
Created on 8 mars 2016
|
||||
|
||||
|
@ -1,32 +1,29 @@
|
||||
# from obitools3.apps.progress cimport ProgressBar # @UnresolvedImport
|
||||
# from obitools3.dms.dms import OBIDMS # TODO cimport doesn't work
|
||||
# from obitools3.utils cimport bytes2str
|
||||
#
|
||||
#
|
||||
# import time
|
||||
# import re
|
||||
|
||||
|
||||
def run(config):
|
||||
pass
|
||||
|
||||
#
|
||||
#
|
||||
# __title__="Export a NUC_SEQS view to a fasta or fastq file"
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# default_config = { 'inputview' : None,
|
||||
# }
|
||||
#
|
||||
#
|
||||
# def addOptions(parser):
|
||||
#
|
||||
#
|
||||
# # TODO put this common group somewhere else but I don't know where
|
||||
# group=parser.add_argument_group('DMS and view options')
|
||||
#
|
||||
#
|
||||
# group.add_argument('--default-dms','-d',
|
||||
# action="store", dest="obi:defaultdms",
|
||||
# metavar='<DMS NAME>',
|
||||
# default=None,
|
||||
# type=str,
|
||||
# help="Name of the default DMS for reading and writing data.")
|
||||
#
|
||||
#
|
||||
# group.add_argument('--input-view','-i',
|
||||
# action="store", dest="obi:inputview",
|
||||
# metavar='<INPUT VIEW NAME>',
|
||||
@ -34,76 +31,77 @@ def run(config):
|
||||
# type=str,
|
||||
# help="Name of the input view, either raw if the view is in the default DMS,"
|
||||
# " or in the form 'dms:view' if it is in another DMS.")
|
||||
#
|
||||
#
|
||||
# group=parser.add_argument_group('obi export specific options')
|
||||
#
|
||||
#
|
||||
# group.add_argument('--format','-f',
|
||||
# action="store", dest="export:format",
|
||||
# metavar='<FORMAT>',
|
||||
# default="fasta",
|
||||
# type=str,
|
||||
# help="Export in the format <FORMAT>, 'fasta' or 'fastq'. Default: 'fasta'.") # TODO export in csv
|
||||
#
|
||||
# def run(config):
|
||||
#
|
||||
#
|
||||
def run(config):
|
||||
pass
|
||||
#
|
||||
# # TODO import doesn't work
|
||||
# NUC_SEQUENCE_COLUMN = "NUC_SEQ"
|
||||
# ID_COLUMN = "ID"
|
||||
# DEFINITION_COLUMN = "DEFINITION"
|
||||
# QUALITY_COLUMN = "QUALITY"
|
||||
#
|
||||
#
|
||||
# special_columns = [NUC_SEQUENCE_COLUMN, ID_COLUMN, DEFINITION_COLUMN, QUALITY_COLUMN]
|
||||
#
|
||||
#
|
||||
# # Open DMS
|
||||
# d = OBIDMS(config['obi']['defaultdms'])
|
||||
#
|
||||
#
|
||||
# # Open input view
|
||||
# iview = d.open_view(config['obi']['inputview'])
|
||||
#
|
||||
#
|
||||
# print(iview.type)
|
||||
#
|
||||
#
|
||||
# # TODO check that the view has the type NUC_SEQS
|
||||
# if ((config['export']['format'] == "fasta") or (config['export']['format'] == "fastq")) and (iview.type != "NUC_SEQS_VIEW") : # TODO find a way to import those macros
|
||||
# raise Exception("Error: the view to export in fasta or fastq format is not a NUC_SEQS view")
|
||||
#
|
||||
#
|
||||
# # Initialize the progress bar
|
||||
# pb = ProgressBar(len(iview), config, seconde=5)
|
||||
#
|
||||
#
|
||||
# i=0
|
||||
# for seq in iview :
|
||||
# pb(i)
|
||||
#
|
||||
#
|
||||
# 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.definition
|
||||
#
|
||||
#
|
||||
# nucseq = bytes2str(seq.nuc_seq)
|
||||
#
|
||||
#
|
||||
# if config['export']['format'] == "fasta" :
|
||||
# nucseq = re.sub("(.{60})", "\\1\n", nucseq, 0, re.DOTALL)
|
||||
#
|
||||
#
|
||||
# toprint = toprint + "\n" + nucseq
|
||||
#
|
||||
#
|
||||
# if config['export']['format'] == "fastq" :
|
||||
# toprint = toprint + "\n" + "+" + "\n" + seq.get_str_quality()
|
||||
#
|
||||
#
|
||||
# print(toprint)
|
||||
# i+=1
|
||||
#
|
||||
#
|
||||
# iview.close()
|
||||
# d.close()
|
||||
#
|
||||
#
|
||||
# print("Done.")
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
@ -20,10 +20,6 @@ from obitools3.dms.capi.obitypes cimport obitype_t, \
|
||||
|
||||
from obitools3.dms.capi.obierrno cimport obi_errno
|
||||
|
||||
import time
|
||||
|
||||
import pickle
|
||||
|
||||
|
||||
__title__="Imports sequences from different formats into a DMS"
|
||||
|
||||
|
Reference in New Issue
Block a user