美文网首页Omics Academy
Python script to generate batch

Python script to generate batch

作者: OmicsAcademy | 来源:发表于2018-10-23 18:45 被阅读0次
    import sys
    #print(sys.argv[1])
    if(len(sys.argv) != 4):
        print("\npython *.py <sample_list> <gtf file> <bam_dir>\n")
        sys.exit()
    
    acc_file = sys.argv[1]
    gtf = sys.argv[2]
    bam_dir = sys.argv[3]
    
    with open(acc_file) as acc_file_handle:
        for line in acc_file_handle:
            line = line.rstrip()
            cmd_str = "htseq-count -f bam -r pos {bam_dir}/{sample}.bam {gtf}  > {sample}.count.tab".format(bam_dir = bam_dir, sample = line, gtf=gtf)
            print(cmd_str)
    

    相关文章

      网友评论

        本文标题:Python script to generate batch

        本文链接:https://www.haomeiwen.com/subject/ahjozftx.html