-
Notifications
You must be signed in to change notification settings - Fork 11
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
21 changed files
with
703 additions
and
495 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
#!/usr/bin/env python | ||
|
||
################################################################################ | ||
### COPYRIGHT ################################################################## | ||
|
||
# New York Genome Center | ||
|
||
# SOFTWARE COPYRIGHT NOTICE AGREEMENT | ||
# This software and its documentation are copyright (2014) by the New York | ||
# Genome Center. All rights are reserved. This software is supplied without | ||
# any warranty or guaranteed support whatsoever. The New York Genome Center | ||
# cannot be responsible for its use, misuse, or functionality. | ||
|
||
# Version: 0.2 | ||
# Author: Andre Corvelo | ||
|
||
################################################################# /COPYRIGHT ### | ||
################################################################################ | ||
|
||
|
||
|
||
################################################################################ | ||
### MODULES #################################################################### | ||
|
||
from optparse import OptionParser | ||
import sys | ||
from itertools import islice | ||
|
||
|
||
################################################################### /MODULES ### | ||
################################################################################ | ||
|
||
|
||
|
||
################################################################################ | ||
### FUNCTIONS ################################################################## | ||
|
||
################################################################# /FUNCTIONS ### | ||
################################################################################ | ||
|
||
|
||
|
||
################################################################################ | ||
### ARGUMENTS,OPTIONS ########################################################## | ||
|
||
parser = OptionParser(usage="\n%prog [options]", version="%prog v0.2") | ||
|
||
parser.add_option( | ||
"-i", | ||
metavar = "FILE", | ||
type = "string", | ||
dest = "input_file", | ||
default = 'stdin', | ||
help = "Input FASTQ file (default = 'stdin')" | ||
) | ||
|
||
(opt, args) = parser.parse_args() | ||
|
||
######################################################### /ARGUMENTS,OPTIONS ### | ||
################################################################################ | ||
|
||
|
||
|
||
################################################################################ | ||
### CONSTANTS ################################################################## | ||
|
||
################################################################# /CONSTANTS ### | ||
################################################################################ | ||
|
||
|
||
|
||
################################################################################ | ||
### MAIN ####################################################################### | ||
|
||
if __name__ == "__main__": | ||
if opt.input_file != 'stdin': | ||
fq = open(opt.input_file, 'r') | ||
else: | ||
fq = sys.stdin | ||
|
||
r0 = None | ||
rid0 = None | ||
while True: | ||
r = [line for line in islice(fq, 4)] | ||
if not r: | ||
break | ||
rid = r[0].replace(' ', '/').split('/')[0] | ||
if rid == rid0: | ||
sys.stdout.write(''.join(r0 + r)) | ||
else: | ||
rid0 = rid | ||
r0 = r | ||
|
||
if opt.input_file != 'stdin': | ||
fq.close() | ||
|
||
###################################################################### /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
Oops, something went wrong.