Esempio n. 1
0
 def __init__(self, working_directory, sample_type, thread, fastq_list,
              info_dict, map_type):
     self.working_directory = working_directory
     self.thread = thread
     self.sample_type = sample_type
     self.map_type = map_type
     self.info_dict = info_dict
     self.fastq_list = fastq_list
     self.file_list = []
     self.paths = GetPaths()
     os.chdir(self.working_directory)
 def __init__(self, working_directory, map_type, sample_type, library_matching_id, thrds, issplitchr):
     self.get_paths = GetPaths()
     self.main_directory = working_directory
     self.folder_directory = working_directory + "/" + map_type
     self.working_directory = working_directory + "/" + map_type + "/Mapping"
     self.map_type = map_type
     self.sample_type = sample_type
     self.library_matching_id = library_matching_id
     self.threads = thrds
     self.bundle_dir = self.get_paths.ref_dir + "hg19_bundle"
     self.split_chr = issplitchr
     self.file_list = []
     os.chdir(self.working_directory)
Esempio n. 3
0
 def __init__(self, working_directory, map_type, sample_type,
              library_matching_id, thrds, gatk_tools):
     self.get_paths = GetPaths()
     self.working_directory = working_directory
     self.map_type = map_type
     self.sample_type = sample_type
     self.library_matching_id = library_matching_id
     self.threads = thrds
     self.bundle_dir = self.get_paths.ref_dir + "hg19_bundle"
     self.gatk_tools = False
     if gatk_tools == "Yes":
         self.gatk_tools = True
     else:
         self.gatk_tools = False
     os.chdir(self.working_directory)
Esempio n. 4
0
 def __init__(self, variant_annotater, wd, sample_name, thread_v, will_annotate, annotate_all):
     self.get_paths = GetPaths()
     self.working_directory = wd
     os.chdir(self.working_directory)
     print(self.working_directory)
     self.sample_name = sample_name
     self.v_annotater = variant_annotater
     self.threads = str(thread_v)
     if annotate_all:
         self.annotate_files = glob.glob("*.vcf")
     else:
         self.annotate_files = will_annotate
     self.humandb = self.get_paths.annovar + "humandb_38/"
     self.xref = self.get_paths.annovar + "example/gene_fullxref.txt"
     self.annovar_dir = self.get_paths.annovar + "table_annovar.pl"
     self.file_list = []
Esempio n. 5
0
    def __init__(self, working_directory, map_type, sample_type,
                 library_matching_id, thrds, trim):
        """
        Parameters
        ----------
        working_directory : str
            The folder directory of where fastq files are in
        map_type : str
            Mapping algorithm decision: Bwa or Bowtie2
        sample_type : str
            Type of sample: Tumor or Germline
        library_matching_id : str
            ID of patient which own the sample
        thrds : str
            Number of cores that wanted to use
        bundle_dir : str
            Path directory for reference files
        file_list : str
            List of files that created in this step
        trim : str
            "Yes" or "No" option must be used. Use "Yes" in order to trim fastq files.
        """

        self.get_paths = GetPaths(
        )  # Get paths of algorithms inside paths.py module
        if working_directory[-1] == "/" or working_directory[-1] == "\\":
            self.working_directory = working_directory[:-1]
        else:
            self.working_directory = working_directory

        self.map_type = map_type
        self.sample_type = sample_type
        self.library_matching_id = library_matching_id
        self.threads = str(
            thrds)  # in case of given as integer it convert to string
        #self.bundle_dir = self.get_paths.ref_dir + "hg19_bundle"  # contains reference bundle
        self.bundle_dir = self.get_paths.ref_dir  # contains reference bundle
        self.folder_directory = self.working_directory
        if trim == "Yes":
            self.trim = True
            self.working_directory = self.working_directory + "/QC"
        else:
            self.trim = False
        self.file_list = []
        self.delete_file_list = []
        os.chdir(self.working_directory)
    def __init__(self,
                 variant_caller,
                 thrds,
                 map_type,
                 germline_bam,
                 wd,
                 tumor_bam,
                 sample_name,
                 tumor_only,
                 tumor_interval=None,
                 germline_interval=None):

        self.get_paths = GetPaths(
        )  # Get paths of algorithms inside paths.py module
        self.working_directory = wd
        up_dir = str(self.working_directory).split("/")[:-1]

        self.folder_directory = "/".join(up_dir)
        os.chdir(self.working_directory)
        print(self.working_directory)
        self.v_caller = variant_caller
        self.map_type = map_type
        self.output_name = self.map_type + "_" + self.v_caller + "_" + sample_name
        self.threads = str(thrds)
        self.ref_dir = self.get_paths.ref_dir + "Homo_sapiens_assembly38.fasta"  # contains reference files
        self.tumor_bam = tumor_bam
        self.germline_bam = germline_bam
        if tumor_only == "Yes":
            self.tumor_only_mode = True
        else:
            self.tumor_only_mode = False

        # If selected variant caller is Mutect2 from GATK3
        if variant_caller == "Mutect2_gatk3":
            self.tumor_interval = tumor_interval
            self.germline_interval = germline_interval
            self.realign_target = self.tumor_interval + " " + self.germline_interval
Esempio n. 7
0
 def __init__(self, folder):
     self.folder = folder
     self.get_paths = GetPaths()
     self.ref_dir = self.get_paths.ref_dir + "Homo_sapiens_assembly38.fasta"
Esempio n. 8
0
def create_index(lastbam, function, threads, step):
    indexcol = "java -Dpicard.useLegacyParser=false -jar " + GetPaths(
    ).picard_path + " BuildBamIndex -I " + lastbam
    log_command(indexcol, function, threads, step)
    return lastbam[:-3] + "bai"
 def __init__(self, normal_file, normal_target_interval):
     self.get_paths = GetPaths()
     self.normal_bam = normal_file
     self.normal_interval = normal_target_interval
     self.output_vcf = "output." + str(self.normal_bam).split("/")
Esempio n. 10
0
def create_index(lastbam, function, threads, step):
    indexcol = "java -jar " + GetPaths(
    ).picard_path + " BuildBamIndex I=" + lastbam
    log_command(indexcol, function, threads, step)
    return lastbam[:-3] + "bai"