Skip to content
Snippets Groups Projects

Michael edits

1 file
+ 15
7
Compare changes
  • Side-by-side
  • Inline
+ 15
7
@@ -28,25 +28,33 @@ for sample in samples.find({}, {'UID': 1, 'BIOSAMPLEID': 1, 'SEGMENTS_HG18': 1})
biosample_id = 'AM_BS__'+callset_id
for seg in sample['SEGMENTS_HG18']:
typevalue = int()
alternate_bases = ''
start = int()
end = int()
varvalue = float()
if seg['SEGTYPE'] < 0:
alternate_bases = 'DEL'
elif seg['SEGTYPE'] > 0:
alternate_bases = 'DUP'
try:
typevalue = int(seg['SEGTYPE'])
if seg['SEGTYPE'] < 0:
alternate_bases = 'DEL'
elif seg['SEGTYPE'] > 0:
alternate_bases = 'DUP'
except TypeError:
print 'TypeError: '+str(callset_id)+' - SEGTYPE; skipping'
continue
try:
start = int(float(seg['SEGSTART']))
except TypeError:
print 'TypeError: '+str(callset_id)+' - SEGSTART'
print 'TypeError: '+str(callset_id)+' - SEGSTART; skipping'
continue
try:
end = int(float(seg['SEGSTOP']))
except TypeError:
print 'TypeError: '+str(callset_id)+' - SEGSTOP'
print 'TypeError: '+str(callset_id)+' - SEGSTOP; skipping'
continue
tag = str(seg['CHRO'])+'_'+str(seg['SEGSTART'])+'_'+str(seg['SEGSTOP'])+'_'+alternate_bases
@@ -55,7 +63,7 @@ for sample in samples.find({}, {'UID': 1, 'BIOSAMPLEID': 1, 'SEGMENTS_HG18': 1})
try:
varvalue = float(seg['SEGVALUE'])
except ValueError:
print 'ValueError: '+str(callset_id)+' - VALUE'
print 'ValueError: '+str(callset_id)+' - VALUE; continuing'
else:
call['VALUE'] = float(seg['SEGVALUE'])
Loading