MCPcopy Index your code
hub / github.com/alignoth/alignoth / test_create_plot_data

Function test_create_plot_data

src/plot.rs:1014–1060  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1012
1013 #[test]
1014 fn test_create_plot_data() {
1015 let region = Region {
1016 target: "chr1".to_string(),
1017 start: 0,
1018 end: 20,
1019 };
1020 let (reads, reference, total_reads, coverage, subsampled_reads) = create_plot_data(
1021 "tests/sample_1/reads.bam",
1022 "tests/sample_1/reference.fa",
1023 &region,
1024 100,
1025 None,
1026 0.0,
1027 )
1028 .unwrap();
1029 let expected_reference = Reference {
1030 start: 0,
1031 reference: "TTGCCGGGGTGGGGAGAGAG".to_string(),
1032 };
1033 let expected_read = Read {
1034 name: "sim_Som1-5-2_chr1_1_1acd6f".to_string(),
1035 cigar: PlotCigar::from_str("16=|iAA|80=|1T|1=").unwrap(),
1036 position: 4,
1037 flags: 99,
1038 mapq: 30,
1039 row: Some(1),
1040 end_position: 106,
1041 mpos: 789264,
1042 aux: AuxRecord(HashMap::new()),
1043 raw_cigar: "16M2I82M".to_string(),
1044 };
1045
1046 let expected_reads = vec![EncodedRead::from_reads(vec![expected_read])];
1047 let expected_coverage = Coverage {
1048 start: 0,
1049 matches: "0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0".to_string(),
1050 a: "".to_string(),
1051 t: "".to_string(),
1052 c: "".to_string(),
1053 g: "".to_string(),
1054 };
1055 assert_eq!(reference, expected_reference);
1056 assert_eq!(coverage, expected_coverage);
1057 assert_eq!(reads, expected_reads);
1058 assert_eq!(total_reads, 1);
1059 assert_eq!(subsampled_reads, 1);
1060 }
1061
1062 #[test]
1063 fn test_create_plot_data_2() {

Callers

nothing calls this directly

Calls 2

create_plot_dataFunction · 0.85
AuxRecordClass · 0.85

Tested by

no test coverage detected