Commit a3beeb69 authored by Yakubov, Sergey's avatar Yakubov, Sergey
Browse files

Merge branch '5-create-script-for-invoking-galaxy-qclimax-tool' into 'main'

qclimax script

Closes #5

See merge request !3
parents 0e196f53 2d89f1a1
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -6,6 +6,17 @@
set _GALAXY_API_KEY_


#### getting tool input right
there is very little documentation on this.
Basically it is recommended call a tool builder and check the output 
https://github.com/galaxyproject/bioblend/blob/main/bioblend/galaxy/tools/__init__.py#L412

e.g.

```python
 print (galaxy_instance.tools.build('neutrons_qclimax',inputs=None,history_id=history_id)["state_inputs"])
```

#### Documentation

some documentation for Bioblend can be found here:
+3916 −0

File added.

Preview size limit exceeded, changes collapsed.

+3916 −0

File added.

Preview size limit exceeded, changes collapsed.

+52 −0
Original line number Diff line number Diff line
import numpy as np

def DeltaCustom(parameters, parameter_names, x, resolution, Q):
    """Calculate the Elastic line for values within +/- 100 of the peak maximum.
        Parameters:
        0: Center
        1: Amplitude
    """
    
    xx0 = parameters[parameter_names[0]].value
    AMP = parameters[parameter_names[1]].value
    
    delta=np.zeros(len(x))
    
    jlower = 0
    jupper = len(x) - 1
    
    while (jupper - jlower > 1 ):
        jmedium = (jupper+jlower) >> 1 
        if ( xx0 >= x[jmedium]):
            jlower = jmedium
        else:
            jupper = jmedium
    delta[jupper] = (xx0 - x[jlower])/(x[jupper] - x[jlower])        
    delta[jlower] = (x[jupper] - xx0)/(x[jupper] - x[jlower]) 
    
    delta[jupper] = delta[jupper] * AMP / (x[jupper] - x[jlower])
    delta[jlower] = delta[jlower] * AMP / (x[jupper] - x[jlower])
    
    """
    
    idx = (np.abs(x-xx0)).argmin()
    pirulo=(x[idx]-xx0)/(x[idx+1]-x[idx])

    if pirulo>0:
        delta[idx-1]=pirulo
        delta[idx]=1-pirulo
    else:
        delta[idx]=1+pirulo
        delta[idx+1]=-pirulo        
    """
    
    return delta

def get_parameters():
    """Returns the string description of the parameters for this function. The strings start with the parameter name, then
    followed by a comma are keyword arguments in the form "keyword=value", separated by commas. This function must return at
    least one keyword argument in the string, "value", to set the initial value. Example: "center,value=0.5"
    
    """
    
    return "cen,value=0.0,min=-3900,max=3900 amp,value=1.0,min=0.0,vary=True"
+6 −0
Original line number Diff line number Diff line
from math import sin,cos

def FirstOrderSphericalBessel(symtable, X):
    """Performs the first order spherical bessel function on the given variable.
    """
    return (sin(X) / (X**2)) - (cos(X) / X)
Loading