-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
76 additions
and
9 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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,5 @@ | ||
seq1 5 112 include_5 | ||
seq1 410 532 overlap_2 | ||
seq1 800 950 empty1_0 | ||
seq2 300 532 shared1_10 | ||
seq2 566 769 shared2_10 |
Binary file not shown.
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,27 @@ | ||
#!/usr/bin/env python | ||
|
||
import argparse, sys | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description="Convert bed file to gtf file.") | ||
parser.add_argument("bed", help="Input bed file.") | ||
parser.add_argument("gtf", help="Output gtf file.") | ||
args = parser.parse_args() | ||
|
||
if args.gtf: | ||
outfile = open(args.gtf, "w") | ||
else: | ||
outfile = sys.stdout | ||
with open(args.bed) as f: | ||
for line in f: | ||
line = line.strip() | ||
if line: | ||
|
||
fields = line.split() | ||
|
||
chrom, start, end, name = fields[0], fields[1], fields[2], fields[3] | ||
strand = "+" | ||
#chr2 215593349 215593782 REG1 | ||
#seq1 bamtocov exon 5 111 . + . gene_id "include_5" | ||
print(f"{chrom}\tbamtocov\texon\t{start}\t{end}\t.\t{strand}\t.\tgene_id \"{name}\"", file=outfile) | ||
|
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,19 @@ | ||
#!/usr/bin/env python3 | ||
import sys | ||
inputfile = sys.argv[1] | ||
|
||
with open(inputfile) as f: | ||
totaldelta = 0 | ||
for line in f: | ||
line = line.strip() | ||
if line: | ||
fields = line.split() | ||
id1, c1, id2, c2 = fields[0], fields[1], fields[2], fields[3] | ||
if id1 == id2: | ||
delta = int(c2) - int(c1) | ||
p = delta / (int(c2)) * 100 if int(c2) > 0 else 0 | ||
|
||
totaldelta += delta | ||
print(f"{id1}\t{delta}\t{p:.2f}\t{c1},{c2}") | ||
|
||
print(f"Total delta: {totaldelta}") |
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