Closed soh-i closed 10 years ago
(Ivy)Aichan >> python seq.py Used existing block <Process(PoolWorker-1, started daemon)> <Process(PoolWorker-2, started daemon)> <Process(PoolWorker-3, started daemon)> <Process(PoolWorker-4, started daemon)> Result: Mapped reads [1663601] in [chrM] Result: Mapped reads [4296699] in [chr18] Result: Mapped reads [22799306] in [chr12] Result: Mapped reads [14953013] in [chr19] Result: Mapped reads [22138479] in [chr6] Result: Mapped reads [26943365] in [chr13] Result: Mapped reads [21519402] in [chr1] Result: Mapped reads [24401792] in [chr20] Result: Mapped reads [26866302] in [chr21] Result: Mapped reads [39871177] in [chr14] Result: Mapped reads [31694543] in [chr22] Result: Mapped reads [37747583] in [chr7] Result: Mapped reads [50465711] in [chr15] Result: Mapped reads [78078919] in [chrX] Result: Mapped reads [48894609] in [chr8] Result: Mapped reads [56534849] in [chr2] Result: Mapped reads [71603831] in [chr16] Result: Mapped reads [61419460] in [chr9] Result: Mapped reads [84398826] in [chr17] Result: Mapped reads [75774975] in [chr3] Result: Mapped reads [74401404] in [chr10] Result: Mapped reads [97693625] in [chr4] Result: Mapped reads [88335995] in [chr11] Result: Mapped reads [108219771] in [chr5] => Elapsed time: 251.212560 (sec) Traceback (most recent call last): File "seq.py", line 258, in <module> run(cpus, get_fa_list(path)) File "seq.py", line 210, in run seq = p.map(fetch_seq, fas) File "/Users/yukke/.pyenv/versions/2.7.5/lib/python2.7/multiprocessing/pool.py", line 250, in map return self.map_async(func, iterable, chunksize).get() File "/Users/yukke/.pyenv/versions/2.7.5/lib/python2.7/multiprocessing/pool.py", line 554, in get raise self._value ValueError: invalid reference `chrY`
このように、このサンプルではY染色体へリードが1本以上mapされていない場合、ValueErrorが放出される。try-exceptionでwrapしたほうがよい。
ValueErrorが放出されたらNoneのtupleを返すように変更。 https://github.com/soh-i/Ivy/blob/050197254e2500be579b808e5aae18bc77b6b759/src/Ivy/alignment/stream.py#L350
このように、このサンプルではY染色体へリードが1本以上mapされていない場合、ValueErrorが放出される。try-exceptionでwrapしたほうがよい。