comparison trackObject.py @ 50:3e5b6f6a9abe draft

planemo upload for repository https://github.com/Yating-L/jbrowse_hub commit 6391cdb975d14b5a7060fa1665a8a575797a0eaa-dirty
author yating-l
date Thu, 30 Mar 2017 16:03:16 -0400
parents a5108e5010b4
children
comparison
equal deleted inserted replaced
49:193e94a43f0f 50:3e5b6f6a9abe
31 """ 31 """
32 false_path = os.path.abspath(dataFile) 32 false_path = os.path.abspath(dataFile)
33 fileName = os.path.basename(dataFile) 33 fileName = os.path.basename(dataFile)
34 des_path = os.path.join(self.raw_folder, fileName) 34 des_path = os.path.join(self.raw_folder, fileName)
35 track = {} 35 track = {}
36 if dataType == 'gff3_mrna' or dataType == 'gff3_transcript' or dataType == 'fasta' or dataType == 'bam' or dataType == 'bigwig' or dataType == 'bai': 36 if dataType == 'bed' or dataType == 'gff3' or dataType == 'gff3_mrna' or dataType == 'gff3_transcript' or dataType == 'fasta' or dataType == 'bam' or dataType == 'bigwig':
37 if dataType == 'bam': 37 if dataType == 'bam':
38 # JBrowse will raise error: not a BAM file if the filename hasn't .bam extension 38 # JBrowse will raise error: not a BAM file if the filename hasn't .bam extension
39 fileName = fileName + '.bam' 39 extension = os.path.splitext(fileName)[1]
40 if extension != '.bam':
41 fileName = fileName + '.bam'
40 des_path = os.path.join(self.raw_folder, fileName) 42 des_path = os.path.join(self.raw_folder, fileName)
41 bam_index = utils.createBamIndex(dataFile) 43 bam_index = utils.createBamIndex(dataFile)
42 indexname = os.path.basename(bam_index) 44 indexname = os.path.basename(bam_index)
43 des_path_for_index = os.path.join(self.raw_folder, indexname) 45 des_path_for_index = os.path.join(self.raw_folder, indexname)
44 shutil.copyfile(bam_index, des_path_for_index) 46 shutil.copyfile(bam_index, des_path_for_index)