in src/main/scripts/model/sample_manifest.py [0:0]
def write(self, extension, files, workflow_name, library_type, sample_libtype=None):
data = {
"parameter_type": self.parameter_type,
"files": files,
"libtype": True if sample_libtype is not None else False,
"tab": '\t'
}
sample_type = 'Fastq' if extension.split('.')[0] == 'fastq' else 'Bam'
main_dir = os.path.dirname(os.path.realpath(__import__("__main__").__file__))
env = Environment(loader=FileSystemLoader("{}/config_templates/templates".format(main_dir)), trim_blocks=True,
lstrip_blocks=True)
template = "sample_manifest_paired_template.txt" \
if self.read_type == 'paired' and self.parameter_type == "fastqFile" \
else "sample_manifest_single_template.txt"
global_template = env.get_template(template)
list_path = "{}_{}_Sample{}Paths.txt".format(workflow_name, library_type, sample_type)
with open(list_path, "w") as f:
f.write(global_template.render(data))
f.close()
return "{}/{}".format(os.getcwd(), list_path)