-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Summary
When attempting to construct a test record with no query sequence or qualities, I found that SamBuilder.add_single()
constructs a record with the default base/quality values instead of a record with None
in these attributes.
In [1]: from fgpyo.sam.builder import SamBuilder
In [2]: builder = SamBuilder()
In [3]: record = builder.add_single(bases=None, quals=None)
In [4]: record.query_sequence
Out[4]: 'AGGGCGACCTTCGATTCGGATGTGACATTTCATTACATTACGCTCAGGACTGCGAACGAAAGATTAAGAATGCTTAACCCGGTACCTAACCCATCTGATT'
In [5]: record.query_qualities
Out[5]: array('B', [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30])
Suggested solution
I think this originates from using None
as a sentinel value for "use the defaults" in this method.
Instead, we could:
- Change the default value for these parameters to the actual default query sequence and qualities, rather than
None
- When
None
is specified as a value for these parameters, return a record wherequery_sequence
andquery_qualities
are None
Metadata
Metadata
Assignees
Labels
No labels