Pseudo obihead for tests
This commit is contained in:
43
python/obitools3/obihead.py
Normal file
43
python/obitools3/obihead.py
Normal file
@ -0,0 +1,43 @@
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
from obitools3.obidms._obidms import OBIDMS
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
parser = argparse.ArgumentParser(description='Pseudo obihead.')
|
||||
|
||||
parser.add_argument('-V', '--view', dest='view', type=str,
|
||||
help='Name of the view that should be considered')
|
||||
|
||||
parser.add_argument('-N', '--new_view', dest='new_view', type=str,
|
||||
help='Name of the new view that should be created')
|
||||
|
||||
parser.add_argument('-n', '--nb', dest='nb_lines', type=int,
|
||||
help='Number of lines that should be taken')
|
||||
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
d = OBIDMS('tdms')
|
||||
|
||||
#condition = 1
|
||||
line_selec = []
|
||||
|
||||
v = d.open_view(args.view)
|
||||
|
||||
for i in range(0, args.nb_lines) :
|
||||
line_selec.append(i)
|
||||
|
||||
new_v = d.new_view(args.new_view, view_to_clone=v, line_selection=line_selec, view_type="NUC_SEQS_VIEW", comments="obihead "+str(args.nb_lines)+", "+args.view+" to "+args.new_view) #args.key+" "+str(args.comparison)+" "+str(args.value)+" "+)
|
||||
|
||||
print("\n")
|
||||
print(new_v.__repr__())
|
||||
|
||||
v.save_and_close()
|
||||
new_v.save_and_close()
|
||||
|
||||
d.close()
|
||||
|
||||
print("\nDone.")
|
||||
|
Reference in New Issue
Block a user