Commit de5cb1b5 authored by Vladimir Reinharz's avatar Vladimir Reinharz
Browse files

README

parent 9588ef58
aRNhAck 1.0
REQUIRED PYTHON LIBRARIES:
Bio-Python
networkx
OPTIONAL DEPENDANCIES:
Infernal: If the WT sequence in the mutate-and-map experiment is not already aligned in the MSA,
the argument '-i' can be used to leverage infernal to produce the alignment http://eddylab.org/infernal/
OUTPUT:
each line contains two numbers (a, b) such that
a: is the disruptive mutation
b: A position satisfying the input parameters in relation to 'a'
usage: arnhack.py [-h] -r RDAT_PATH -s MSA_PATH -d DELTA -g GAMMA -z ZETA [-i]
required arguments:
-r RDAT_PATH, --rdat_path RDAT_PATH
Path to mutate-and-map 'rdat' file
-s MSA_PATH, --msa_path MSA_PATH
Path to multiple sequence alignment 'stockholm' file
-d DELTA, --shape_disruption_percentile DELTA
The percentile cutoff of the SHAPE profile disruption
-g GAMMA, --gamma_distance GAMMA
Minimal distance in the graph to be considered for the
mutations
-z ZETA, --npmi_percentile ZETA
The percentile cutoff of the NPMI
optional arguments:
-h, --help show this help message and exit
-i, --infernal Uses infernal to align the wt to the provided MSA The
resulting alignment will be saved in the file
"rdat_path_msa_path"
As an example, the files provided in NAR_2016_DATA can be used:
python arnhack.py -r ../NAR_2016_DATA/Data/5SRRNA_SHP_0002.rdat -s ../NAR_2016_DATA/Data/5SRRNA_SHP_0002_RF00001.stockholm.txt -d 98 -g 22 -z 90
Output:
83 48
83 34
83 45
116 42
116 43
116 37
Which mean that mutations 83 (resp. 116) is in the 98th percentile of SHAPE profile disruption and that mutations 48, 34 and 45 (resp. 42, 43 and 37) are at a distance of at least 22 and are each in the 90th percentile of NPMI values.
###############################################################################
#Copyright (c) 2016, Vladimir Reinharz, Yann Ponty & Jerome Waldispuhl #
#All rights reserved. #
# #
#Redistribution and use in source and binary forms, with or without #
#modification, are permitted provided that the following conditions are met: #
#* Redistributions of source code must retain the above copyright #
#notice, this list of conditions and the following disclaimer. #
#* Redistributions in binary form must reproduce the above copyright #
#notice, this list of conditions and the following disclaimer in the #
#documentation and/or other materials provided with the distribution. #
#* Neither the name of the <organization> nor the #
#names of its contributors may be used to endorse or promote products #
#derived from this software without specific prior written permission. #
# #
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND#
#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED#
#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
#DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY #
#DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES #
#(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND #
#ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT #
#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS#
#SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE #
###############################################################################
"""
Requirement:
Bio-Python
networkx
Optional:
Infernal: with -i option
"""
import os
......@@ -378,7 +405,6 @@ class Arnhack(object):
val: list of position in MSA over npmi threshold
"""
self.get_disruptive_muts
out = {}
sig = self.get_all_mut_npmi_percentile(npmi_percentile)
for mut in self.get_disruptive_muts(mut_percentile):
......@@ -589,10 +615,19 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(description='aRNhAck')
parser.add_argument('-r', '--rdat_path', nargs=1, type=str,
help="Path to mutate-and-map 'rdat' file",
dest='rdat_path')
dest='rdat_path', required=True)
parser.add_argument('-s', '--msa_path', nargs=1, type=str,
help="Path to multiple sequence alignment 'stockholm' file",
dest='msa_path')
dest='msa_path', required=True)
parser.add_argument('-d', '--shape_disruption_percentile', type=float,
help="The percentile cutoff of the SHAPE profile disruption",
dest='delta', required=True)
parser.add_argument('-g', '--gamma_distance', type=int,
help="Minimal distance in the graph to be considered for the mutations",
dest='gamma', required=True)
parser.add_argument('-z', '--npmi_percentile', type=float,
help="The percentile cutoff of the NPMI",
dest='zeta', required=True)
parser.add_argument('-i', '--infernal', action='count',
help='''Uses infernal to align the wt to the provided MSA
The resulting alignment will be saved in the file
......@@ -600,6 +635,22 @@ if __name__ == '__main__':
''',
dest='infernal_ali')
args = parser.parse_args()
if not 0 <= args.delta <= 100:
print """The SHAPE profile disruption percentile cutoff must be a float between 0 and 100,
For help do:
python arnhack -h"""
sys.exit(1)
if not 0 <= args.zeta <= 100:
print """The NPMI percentile cutoff must be a float between 0 and 100
For help do:
python arnhack -h"""
sys.exit(1)
arn = Arnhack(args.rdat_path[0])
arn.add_msa(args.msa_path[0], infernal_align=args.infernal_ali)
arn.msa_npmi()
d_sign, _ = arn.get_mut_pos_shapeDelta_gamma_zeta(args.delta, args.gamma, args.zeta)
for key, muts in d_sign.iteritems():
for m in muts:
print key, m
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment