def _validate_reads(self): c = 0 for read_file in self.reads: if not Utilities.is_file_valid(read_file, False): print("Not found the raw read file: '{}'".format(read_file)) c += 1 self.is_valid = c == 0
def dump_index_guide(input_nucleotide_fasta: str, output_dir: str): if not Utilities.is_file_valid(input_nucleotide_fasta): raise ValueError(f"Invalid file: '{input_nucleotide_fasta}'") cmd_0 = f""" export IMG=ivasilyev/bwt_filtering_pipeline_worker:latest && \ docker pull "$IMG" && \ docker run --rm -v /data:/data -v /data1:/data1 -v /data2:/data2 -it "$IMG" \ bash -c ' cd "{output_dir}"; python3 "$HOME/scripts/cook_the_reference.py" \ --input "{input_nucleotide_fasta}" \ --output "{output_dir}"; ' """ cmd = Utilities.join_lines(cmd_0) out_file = os.path.join(output_dir, "index.sh") Utilities.dump_string(cmd, out_file) print(f"For indexing, run outside of Docker: 'bash \"{out_file}\"'")