Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added scripts for new genomes and allele frequency queries, and modif…
…ied *_map.py outputs.
- Loading branch information
Showing
9 changed files
with
522 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/python | ||
# Filename: cgi_to_gff.py | ||
|
||
""" | ||
usage: %prog CGI-Variations-Compact.csv ... | ||
""" | ||
|
||
# Output GFF record for each entry in file(s) | ||
# --- | ||
# This code is part of the Trait-o-matic project and is governed by its license. | ||
|
||
import fileinput, os, sys | ||
|
||
def main(): | ||
# return if we don't have the correct arguments | ||
if len(sys.argv) < 2: | ||
raise SystemExit(__doc__.replace("%prog", sys.argv[0])) | ||
|
||
for line in fileinput.input(): | ||
if line.startswith("#"): | ||
continue | ||
l = line.strip().split(",") | ||
if len(l) < 10 or l[4] not in ["=", "snp"] or l[5] not in ["=", "snp"]: | ||
continue | ||
|
||
chr = l[1] | ||
# for now, we treat PAR1 and PAR2 normally, with chrX coordinates | ||
if chr in ["PAR1", "PAR2", "chrXnonPAR"]: | ||
chr = "chrX" | ||
elif chr == "chrYnonPAR": | ||
chr = "chrY" | ||
|
||
out_line = chr | ||
out_line += "\tcgi\tSNP\t" | ||
out_line += str(long(l[2]) + 1) + "\t" + l[3] | ||
out_line += "\t.\t+\t.\t" | ||
|
||
if l[7] == l[8]: | ||
out_line += "alleles " + l[7] | ||
else: | ||
out_line += "alleles " + l[7] + "/" + l[8] | ||
|
||
out_line += ";ref_allele " + l[6] | ||
out_line += ";total_score " + l[9] | ||
|
||
print out_line | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.