This file is indexed.

/usr/share/pyshared/cogent/app/unafold.py is in python-cogent 1.5.3-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env python

"""Application controller for unafold 3.2, hybrid_ss_min application, package

Rest fo unafold package might be added at a later time
"""

from cogent.app.util import CommandLineApplication,\
    CommandLineAppResult, ResultPath
from cogent.app.parameters import Parameter, FlagParameter, ValuedParameter,\
    Parameters

__author__ = "Shandy Wikman"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__contributors__ = ["Shandy Wikman"]
__license__ = "GPL"
__version__ = "1.5.3"
__maintainer__ = "Shandy Wikman"
__email__ = "ens01svn@cs.umu.se"
__status__ = "Development"
                                      
class hybrid_ss_min(CommandLineApplication):
    """Application controller for hybrid_ss_min application

    Computes a minimum energy folding for a RNA or DNA sequence
    """
    
    #not all options supported here!
    #left out: -n,-d,-r,-f,-I,-q,-c,-b and all obscure options
    _parameters = {
	't':ValuedParameter(Prefix='-',Name='t',Value=None,Delimiter=' '),
	'T':ValuedParameter(Prefix='-',Name='T',Value=None,Delimiter=' '),
	'i':ValuedParameter(Prefix='-',Name='i',Value=None,Delimiter=' '),
	's':ValuedParameter(Prefix='-',Name='s',Value=None,Delimiter=' '),
	'o':ValuedParameter(Prefix='-',Name='o',Value=None,Delimiter=' '),
	'N':ValuedParameter(Prefix='-',Name='N',Value=None,Delimiter=' '),
	'M':ValuedParameter(Prefix='-',Name='M',Value=None,Delimiter=' '),
	'p':ValuedParameter(Prefix='-',Name='p',Value=None,Delimiter=' '),
	'E':FlagParameter(Prefix='-',Name='E'),
	'F':ValuedParameter(Prefix='-',Name='F',Value=None,Delimiter=' '),
	'm':ValuedParameter(Prefix='-',Name='m',Value=None,Delimiter=' ')}
	


    _command = 'hybrid-ss-min'
    _input_handler = '_input_as_string'

    def _get_result_paths(self,data):
	"""Return a dict of ResultPath objects representing all possible output

    This dictionary will have keys based
    on the name that you'd like to access the file by in the 
    CommandLineAppResult object that will be created, and the values
    which are ResultPath objects."""

	result = {}
        #UNAfold default values
	start_tmp = 37
	step = 1
	end_tmp = 38

	if isinstance(data,list):
	    filename=self._input_filename.split('/')[-1]
	else:
	    filename=data.split('/')[-1]
    
	result['ct']= \
	    ResultPath(Path=(self.WorkingDir+filename+'.ct'))
	result['dG'] = \
	    ResultPath(Path=(self.WorkingDir+filename+'.dG'))
	result['run'] = \
	    ResultPath(Path=(self.WorkingDir+filename+'.run'))

	#if temp interval is not default it will result in more output-files
        #one for every temp
	if self.Parameters['t'].Value is not None:
	    start_tmp = self.Parameters['t'].Value
	if self.Parameters['T'].Value is not None:
	    end_tmp = self.Parameters['T'].Value + 1
	if self.Parameters['i'].Value is not None:
	    step = self.Parameters['i'].Value
	for i in range(start_tmp,end_tmp,step):
	    temp = str(i)
	    result['plot_%d' % i]= \
	    ResultPath(Path=(self.WorkingDir+filename+'.'+temp+'.plot'))
	    result['ext_%d' % i]= \
	    ResultPath(Path=(self.WorkingDir+filename+'.'+temp+'.ext'))

	return result