Exemplo n.º 1
0
 def test_duplicate_seq_ids(self):
     """Test file with duplicates identifiers."""
     file1 = os.path.join(path, "duplicate_names.fastq")
     result_lib_1, result_lib_2, mate_relationship = infer(file1)
     assert result_lib_1 == "invalid_file" and \
         result_lib_2 == "not_available" and \
         mate_relationship == "not_available"
Exemplo n.º 2
0
 def test_second_mate(self):
     """Test single file, second mate."""
     file1 = os.path.join(path, "SRR11971713_2.fastq")
     result_lib_1, result_lib_2, mate_relationship = infer(file1)
     assert result_lib_1 == "second_mate" and \
         result_lib_2 == "not_available" and \
         mate_relationship == "not_available"
Exemplo n.º 3
0
 def test_single_file(self):
     """Test single file, first mate."""
     file_1 = os.path.join(path, "first_mate.fastq")
     result_lib_1, result_lib_2, mate_relationship = infer(file_1)
     assert result_lib_1 == "first_mate" and \
         result_lib_2 == "not_available" and \
         mate_relationship == "not_available"
Exemplo n.º 4
0
 def test_compressed_file(self):
     """Test single compressed file."""
     file1 = os.path.join(path, "SRR11971558_1.fastq.gz")
     result_lib_1, result_lib_2, mate_relationship = infer(file1)
     assert result_lib_1 == "mixed_mates" and \
         result_lib_2 == "not_available" and \
         mate_relationship == "not_available"
def test_max_records():
    file1 = os.path.join(path, "first_mate.fastq")
    file2 = os.path.join(path, "second_mate.fastq")
    result_lib_1, result_lib_2, mate_relationship = infer(file1, file2, 2)
    assert result_lib_1 == "first_mate" and \
        result_lib_2 == "second_mate" and \
        mate_relationship == "split_mates"
def test_not_mates():
    file1 = os.path.join(path, "SRR11972514_1.fastq")
    file2 = os.path.join(path, "SRR11971713_2.fastq")
    result_lib_1, result_lib_2, mate_relationship = infer(file1, file2)
    assert result_lib_1 == "first_mate" and \
        result_lib_2 == "second_mate" and \
        mate_relationship == "not_mates"
def test_invalid_identifiers():
    file1 = os.path.join(path, "SRR11971713_1.fastq")
    file2 = os.path.join(path, "SRR11971558_2.fastq")
    result_lib_1, result_lib_2, mate_relationship = infer(file1, file2)
    assert result_lib_1 == "no_mate_info" and \
        result_lib_2 == "no_mate_info" and \
        mate_relationship == "not_mates"
Exemplo n.º 8
0
 def test_empty_file(self):
     """Test empty file."""
     file1 = os.path.join(path, "SRR11971713_1.fastq")
     file1 = os.path.join(path, "empty.fastq")
     result_lib_1, result_lib_2, mate_relationship = infer(file1)
     assert result_lib_1 == "invalid_file" and \
         result_lib_2 == "not_available" and \
         mate_relationship == "not_available"
Exemplo n.º 9
0
 def test_split_mates(self):
     """Test two files, split mates."""
     file1 = os.path.join(path, "first_mate.fastq")
     file2 = os.path.join(path, "second_mate.fastq")
     result_lib_1, result_lib_2, mate_relationship = infer(file1, file2)
     assert result_lib_1 == "first_mate" and \
         result_lib_2 == "second_mate" and \
         mate_relationship == "split_mates"
Exemplo n.º 10
0
 def test_max_records(self):
     """Test two files, split mates; set max records argument"""
     file1 = os.path.join(path, "first_mate.fastq")
     file2 = os.path.join(path, "second_mate.fastq")
     result_lib_1, result_lib_2, mate_relationship = infer(
         file_1=file1,
         file_2=file2,
         max_records=2,
     )
     assert result_lib_1 == "first_mate" and \
         result_lib_2 == "second_mate" and \
         mate_relationship == "split_mates"
Exemplo n.º 11
0
def main() -> None:
    """Main function.

    Args:
        args: Command-line arguments and their values.
    """
    args = parse_args()
    setup_logging(
        verbose=args.verbose,
        debug=args.debug,
    )
    logger.info("Started script...")
    logger.debug(f"CLI options: {args}")
    results = {}
    results['single_paired'] = infer_single_paired.infer(
        file_1=args.file_1,
        file_2=args.file_2,
    )
    logger.info(f"Results: {results}")
    logger.info("Done.")
def test_duplicate_seq_ids():
    file1 = os.path.join(path, "duplicate_names.fastq")
    result_lib_1, result_lib_2, mate_relationship = infer(file1)
    assert result_lib_1 == "invalid_file" and \
        result_lib_2 == "not_available" and \
        mate_relationship == "not_available"
def test_invalid_file():
    file1 = os.path.join(path, "SRR11972514_1.fast")
    result_lib_1, result_lib_2, mate_relationship = infer(file1)
    assert result_lib_1 == "invalid_file" and \
        result_lib_2 == "not_available" and \
        mate_relationship == "not_available"
def test_empty_file():
    file1 = os.path.join(path, "empty.fastq")
    result_lib_1, result_lib_2, mate_relationship = infer(file1)
    assert result_lib_1 == "invalid_file" and \
        result_lib_2 == "not_available" and \
        mate_relationship == "not_available"