18 from typing
import Optional, Union, List
19 from pathlib
import Path
21 from ..utils
import command
22 from ..entities
import CustomDataset
26 forwardFile: Union[str, Path],
27 forwardOutput: Union[str, Path],
29 reverseFile: Optional[Union[str, Path]] =
None,
30 reverseOutput: Optional[Union[str, Path]] =
None,
31 reverseAdapter: Optional[str] =
None
34 Used to trim adapter sequences from sigle-end and paired-end sequencing reads
39 Path to the file holding forward sequences
41 Path to the output file for forward sequences
43 The adapter sequence for the forward reads
44 reverseFile : Optional[str]
45 Path to the file holding reverse sequences (pass for paired-end reads,
46 otherwise only forward is required for single-end)
47 reverseOutput : Optional[str]
48 Path to the output file for reverse sequences (pass for paired-end reads,
49 otherwise only forward is required for single-end)
50 reverseAdapter : Optional[str]
51 The adapter sequence for the reverse reads (pass for paired-end reads,
52 otherwise only forward is required for single-end)
55 if isinstance(forwardFile, Path):
56 forwardFile = str(forwardFile)
58 if isinstance(forwardOutput, Path):
59 forwardOutput = str(forwardOutput)
61 if isinstance(reverseFile, Path):
62 reverseFile = str(reverseFile)
64 if isinstance(reverseOutput, Path):
65 reverseOutput = str(reverseOutput)
73 if reverseOutput
is not None and reverseAdapter
is not None:
79 args.append(forwardFile)
80 if reverseFile
is not None:
81 args.append(reverseFile)
86 def isPairedEnd(dataset: CustomDataset) -> bool:
88 Check to see if the dataset has paired-end sequences, i.e. two fastq files
89 per sample (excluding the metadata file)
93 dataset : CustomDataset
94 Coretex dataset that will be checked for paired-end sequences
98 bool -> True if paired-end, False otherwise
101 for sample
in dataset.samples:
104 if sample.name.startswith(
"_metadata"):
107 if len(list(sample.path.glob(
"*.fastq*"))) != 2: