def fix_query_reflength(sequence_length, queries, doubled):
"""
arguments:
<sequence_length> This is the reference fasta length. It should be 2x the actual
length of the reference since this program takes a sam file from
a concatenated reference.
<queries> This is a list of SQL-type query strings. This is generated
from argparse.
purpose:
This function takes in a list of queries to use for read filtering
for the redwood plot. It is often not advisable to plot all mapped reads
since many of them are too small relative to the reference length. Also,
the point of a death star plot is to show continuity of a circular
reference, so short reads aren't very helpful there either.
Currently, this function only recognizes the keyword argument 'reflength'.
"""
if not doubled:
sequence_length = int(sequence_length * 2)
for i in range(len(queries)):
if 'reflength' in queries[i].split():
queries[i] = queries[i].replace('reflength', str(int(sequence_length/2)))
评论列表
文章目录