Skip to content

Commit

Permalink
Support alignment conversion from/to CIGAR
Browse files Browse the repository at this point in the history
  • Loading branch information
padix-key committed Dec 17, 2023
1 parent 971def4 commit 8d17ce0
Show file tree
Hide file tree
Showing 5 changed files with 559 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/apidoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@
"Permutation",
"RandomPermutation",
"FrequencyPermutation"
],
"CIGAR strings" : [
"CigarOp",
"read_alignment_from_cigar",
"write_alignment_to_cigar"
]
},

Expand Down
5 changes: 5 additions & 0 deletions doc/examples/scripts/sequence/gene_counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,13 @@ def read_iter(fastq_path):
# displayed.
# The alignment itself is also discarded here, but note that it could
# also be used in downstream analysis.
#
# Read alignments are typically stored in file formats like SAM/BAM
# :footcite:`Li2009`.
# The package `pysam <https://pysam.readthedocs.io/en/latest/>`_
# provides an interface to these formats.
# To convert an alignment into a CIGAR string, the function
# :func:`write_alignment_to_cigar()` can be used.

counts = np.zeros(len(sequences), dtype=int)
for gene_index, alignment in mapping_results:
Expand Down
1 change: 1 addition & 0 deletions src/biotite/sequence/align/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from .alignment import *
from .banded import *
from .buckets import *
from .cigar import *
from .kmeralphabet import *
from .kmertable import *
from .kmersimilarity import *
Expand Down
Loading

0 comments on commit 8d17ce0

Please sign in to comment.