Skip to content

Commit

Permalink
Merge pull request #17 from yhoogstrate/ericscript_format_fix
Browse files Browse the repository at this point in the history
Fixes support for EricScript, installation numpy & exception handling
  • Loading branch information
yhoogstrate committed Feb 8, 2016
2 parents 86b49dc + 2a42104 commit 73b28c6
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 43 deletions.
8 changes: 8 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2015-02-08 Youri Hoogstrate

* Version 2.11.3: Fixes support for EricScript

- Addresses an installation issue with numpy

- More convenient way of throwing exceptions if files are being parsed improperly

2015-02-07 Youri Hoogstrate

* Version 2.11.2: Support for SOAPFuse and EricScript
Expand Down
80 changes: 40 additions & 40 deletions bin/fuma
Original file line number Diff line number Diff line change
Expand Up @@ -63,129 +63,129 @@ if __name__ == "__main__":
if(input_format_stripped in ["cg","completegenomics"]):
try:
samples[sample_name] = ReadCGhighConfidenceJunctionsBeta(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# Chimerascan BEDPE
elif(input_format_stripped in ["chimerascan"]):
try:
samples[sample_name] = ReadChimeraScanAbsoluteBEDPE(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# Defuse
elif(input_format_stripped in ["defuse"]):
try:
samples[sample_name] = ReadDefuse(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# TopHat Fusion
elif(input_format_stripped in ["tophatfusionpostpotentialfusion"]):
try:
samples[sample_name] = ReadTophatFusionPostPotentialFusion(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))
elif(input_format_stripped in ["tophatfusionpostresult"]):
try:
samples[sample_name] = ReadTophatFusionPostResult(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))
elif(input_format_stripped in ["tophatfusionpostresulthtml"]):
try:
samples[sample_name] = ReadTophatFusionPostResultHtml(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))
elif(input_format_stripped in ["tophatfusionpre"]):
try:
samples[sample_name] = ReadTophatFusionPre(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# FusionCatcher
elif(input_format_stripped in ["fusioncatcherfinal","fusioncatcherfinallist","fusioncatcherfinallistcandidatefusiongenes"]):
try:
samples[sample_name] = ReadFusionCatcherFinalList(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# FusionMap
elif(input_format_stripped in ["fusionmap"]):
try:
samples[sample_name] = ReadFusionMap(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# Chimera's prettyPrint() output
elif(input_format_stripped in ["chimera"]):
try:
samples[sample_name] = ReadChimeraPrettyPrint(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# SOAPFuse '.final.Fusion.specific.for.genes.txt'
elif(input_format_stripped in ["soapfusefinalgene"]):
try:
samples[sample_name] = ReadSOAPFuseGenes(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# SOAPFuse '.final.Fusion.specific.for.trans.txt'
elif(input_format_stripped in ["soapfusefinaltranscript"]):
try:
samples[sample_name] = ReadSOAPFuseTranscripts(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# EricScript '.results.total.txt'
elif(input_format_stripped in ["ericscript"]):
try:
samples[sample_name] = ReadSOAPFuseTranscripts(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
samples[sample_name] = ReadEricScriptResultsTotal(sample_filename,sample_name)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# 1-2-3-SV
elif(input_format_stripped in ["123sv"]):
try:
samples[sample_name] = Read123SVDeNovo(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# RNA-STAR & STAR-Fusion
elif(input_format_stripped in ["rnastarchimeric"]):
try:
samples[sample_name] = ReadRNASTARChimeric(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))
elif(input_format_stripped in ["starfusionfinal"]):
try:
samples[sample_name] = ReadRNASTARFusionFinal(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# Oncofuse
elif(input_format_stripped in ["oncofuse"]):
try:
samples[sample_name] = ReadOncofuse(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# Trinity / GMAP
elif(input_format_stripped in ["trinitygmap"]):
try:
samples[sample_name] = ReadTrinityGMAP(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

# ---
elif(input_format_stripped in ["illuminahiseq","illuminahiseqvcf"]):
try:
samples[sample_name] = ReadIlluminaHiSeqVCF(sample_filename,sample_name)
except:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format)
except Exception as e:
raise Exception("Sample '"+sample_name+ "' could not be parsed as filetype: "+input_format+"\n\n"+str(e))

else:
raise Exception("unsupported sample type: "+input_format)
raise Exception("unsupported/unknown data format: "+input_format)

if(args.link_sample_to_annotation):
for link in args.link_sample_to_annotation:
Expand Down
2 changes: 1 addition & 1 deletion fuma/Readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<http://epydoc.sourceforge.net/manual-fields.html#fields-synonyms>
"""

import logging
import logging,sys
import re

from Fusion import Fusion
Expand Down
2 changes: 1 addition & 1 deletion fuma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<http://epydoc.sourceforge.net/manual-fields.html#fields-synonyms>
"""

__version_info__ = ('2', '11', '2')
__version_info__ = ('2', '11', '3')
__version__ = '.'.join(__version_info__) if (len(__version_info__) == 3) else '.'.join(__version_info__[0:3])+"-"+__version_info__[3]
__author__ = 'Youri Hoogstrate'
__homepage__ = 'https://github.com/yhoogstrate/fuma'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
scripts=["bin/fuma","bin/defuse-clusters-to-CG",'bin/chimerascan-exclude-transcriptome-events',"bin/fusioncatcher-to-CG","bin/chimerascan-relative-bedpe-to-CG","bin/fuma-list-to-boolean-list"],
packages=['fuma'],
test_suite="tests",
install_requires=['HTSeq >= 0.6.1'],
install_requires=['HTSeq >= 0.6.1','numpy'],
classifiers=[
'Environment :: Console',
'Intended Audience :: Science/Research',
Expand Down

0 comments on commit 73b28c6

Please sign in to comment.