-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17d0af7
commit 5091d65
Showing
2 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"""Test importing salmon quantification files.""" | ||
|
||
from pathlib import Path | ||
from typing import List | ||
|
||
import anndata as ad | ||
|
||
from pytximport import tximport | ||
|
||
|
||
def test_anndata_replicates( | ||
fabry_disease_files: List[Path], | ||
) -> None: | ||
"""Test importing quantification files with inferential replicates with AnnData output. | ||
Args: | ||
fabry_disease_files (List[Path]): The paths to the quantification files. | ||
""" | ||
fabry_directory = fabry_disease_files[0].parent | ||
|
||
result = tximport( | ||
fabry_disease_files, | ||
"salmon", | ||
fabry_directory / "transcript_gene_mapping_human.tsv", | ||
ignore_transcript_version=True, | ||
ignore_after_bar=True, | ||
output_type="anndata", | ||
inferential_replicates=True, | ||
inferential_replicate_variance=True, | ||
inferential_replicate_transformer=None, # Do not recalculate counts but include the inferential replicates | ||
) | ||
|
||
assert isinstance(result, ad.AnnData), "The result is not an AnnData object." | ||
|
||
# Check that variance is in the obsm | ||
assert "variance" in result.obsm.keys() | ||
|
||
# Check that inferential replicates is in the uns | ||
assert "inferential_replicates" in result.uns.keys() |