-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring old stuff, general cleanup
- Loading branch information
Showing
8 changed files
with
145 additions
and
138 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 |
---|---|---|
|
@@ -47,4 +47,4 @@ def main(args): | |
|
||
|
||
if __name__ == '__main__': | ||
gff_to_bed(get_args()) | ||
main(get_args()) |
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,37 @@ | ||
#!/usr/bin/env python3 | ||
# Author: Jeffrey Grover | ||
# Purpose: Append a string to all chromosome IDs | ||
# Created: 2019-03-14 | ||
|
||
from argparse import ArgumentParser | ||
|
||
|
||
def append_chromosome(input_file, chrom_string): | ||
with open(input_file, 'r') as input_handle: | ||
for line in input_handle: | ||
entry = line.strip().split('\t') | ||
entry[0] = entry[0] + chrom_string | ||
print('\t'.join(entry)) | ||
|
||
|
||
# Parse command line options | ||
|
||
def get_args(): | ||
parser = ArgumentParser( | ||
description='Appends a string to all chromosomes in a GTF file') | ||
parser.add_argument('gtf', help='File to process', metavar='FILE.gtf') | ||
parser.add_argument('--string', | ||
'-s', | ||
help='String to add to each chromosome ID') | ||
return parser.parse_args() | ||
|
||
|
||
# Process file | ||
|
||
|
||
def main(args): | ||
append_chromosome(args.gtf, args.string) | ||
|
||
|
||
if __name__ == '__main__': | ||
main(get_args()) |
This file was deleted.
Oops, something went wrong.
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
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