python23

作者: rong酱 | 来源:发表于2022-01-23 21:44 被阅读0次
    #!/usr/bin/env python
    
    import os
    import sys
    
    inputfile=sys.argv[1]
    outputfile=sys.argv[2]
    
    u=open(outputfile,'w')
    
    with open(inputfile,'r') as s:
        si=s.readlines()
        for sil in si:
            sili=sil.strip()
            if str(sili[0]) == ">":
                u.write(sil)
                n=0
            else:
                for silib in sili:
    #               bc=silib.lower()
                    bc=silib.upper()
                    n=n+1
                    u.write(bc)
                    if n%80 == 0:
                        u.write("\n")
                if n%80 != 0:
                    u.write("\n")
    
    #!/usr/bin/env python
    
    u=open('3utr_mouse.fa','w')
    
    with open('mouse_3utr.fa','r') as s:
        si=s.readlines()
        for sil in si:
            sili=sil.strip()
            if str(sili[0]) == ">":
                u.write(sil)
                n=0
            else:
                for silib in sili:
                    bc=silib.lower()
                    n=n+1
                    u.write(bc)
                    if n%50 == 0:
                        u.write("\n")
                if n%50 != 0:
                    u.write("\n")
    

    相关文章

      网友评论

          本文标题:python23

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