<commit_before><commit_msg>Create FilterDepth.py<commit_after>
import sys
import math

def main():

     records = open(sys.argv[1], "r")
     outfile = open(sys.argv[2], "w")
     filter = int(sys.argv[3])
     alleles = float(sys.argv[4])

     for record in records:

          record = record.strip()
          record = record.split()

          if record[0].startswith('#'):
               for x in record:
                    outfile.write("%s\t" % x)
               outfile.write('\n')
               continue


          Info = record[7].split(';')
          if Info[0] == "INDEL":
               for x in record:
                    outfile.write("%s\t" % x)
               outfile.write('\n')
               continue

          for i in range(len(Info)):

               if Info[i].startswith('DP4'):
                    DP = Info[i].split('=')
                    Depth = DP[1].split(',')
                    Total = int(Depth[0]) + int(Depth[1]) + int(Depth[2]) + int(Depth[3])
                    ratio = float(((float(Depth[2]) + float(Depth[3])+1))/((float(Depth[0]) + float(Depth[1])+1)))
                    break

          if Total > filter:
               if ratio >= alleles:
                    for x in record:
               outfile.write("%s\t" % x)
                    outfile.write('\n')



     records.close()
     outfile.close()


{'fraction_non_alphanumeric': 0.1565025716385011, 'fraction_numerical': 0.013960323291697281, 'mean_word_length': 1.397887323943662, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5953389', 'n_tokens_mistral': 420, 'n_tokens_neox': 393, 'n_words': 84}