test/preprocess_tests/convert_fastqs_to_unmapped_bam_test.py:
High-level description
This file contains unit tests for theconvert_fastqs_to_unmapped_bam function in the cassiopeia.preprocess.pipeline module. The tests verify the correct conversion of FASTQ files to unmapped BAM files for different sequencing chemistries.
Code Structure
The main classTestConvertFastqsToUnmappedBam contains several test methods, each testing a different sequencing chemistry. The tests use sample FASTQ files and verify the correct conversion to BAM format, including proper tag assignments.
Symbols
TestConvertFastqsToUnmappedBam
Description
A unittest.TestCase subclass that contains test methods for theconvert_fastqs_to_unmapped_bam function.
Internal Logic
- Sets up test FASTQ file paths in the
setUpmethod - Implements test methods for different sequencing chemistries (dropseq, 10xv2, 10xv3, indropsv3, slideseq2)
- Each test method:
- Calls
convert_fastqs_to_unmapped_bamwith appropriate parameters - Reads the resulting BAM file
- Verifies the correct number of alignments, query names, sequences, and qualities
- Checks the correct assignment of BAM tags (UR, UY, CR, CY, RG)
- Calls
setUp
Description
Initializes the test environment by setting up file paths for test FASTQ files.test_dropseq
Description
Tests the conversion of FASTQ files to BAM for the Drop-seq chemistry.test_10xv2
Description
Tests the conversion of FASTQ files to BAM for the 10x Genomics v2 chemistry.test_10xv3
Description
Tests the conversion of FASTQ files to BAM for the 10x Genomics v3 chemistry.test_indropsv3
Description
Tests the conversion of FASTQ files to BAM for the inDrops v3 chemistry.test_slideseq2
Description
Tests the conversion of FASTQ files to BAM for the Slide-seq v2 chemistry.Dependencies
| Dependency | Purpose |
|---|---|
| os | File path operations |
| unittest | Unit testing framework |
| tempfile | Creating temporary directories |
| pysam | Reading and manipulating BAM files |
| ngs_tools | FASTQ file handling |
| cassiopeia.preprocess.pipeline | Module containing the function being tested |
