Skip to content

Commit

Permalink
Merge pull request #606 from hechth/hechth/issue603
Browse files Browse the repository at this point in the history
Updated mfassignr to version 1.1.2
  • Loading branch information
hechth authored Nov 1, 2024
2 parents 5da5b5e + f515aa6 commit 7d98b78
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 121 deletions.
22 changes: 1 addition & 21 deletions tools/mfassignr/macros.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<macros>
<token name="@TOOL_VERSION@">1.1.1</token>
<token name="@TOOL_VERSION@">1.1.2</token>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">r-mfassignr</requirement>
Expand Down Expand Up @@ -208,26 +208,6 @@
</section>
</xml>

<xml name="findrecalseries_param">
<param name="input_file" type="data" format="tabular" label="Input data"
help= "Recalibration series, output from RecalList"/>
<param name="global_min" type="float" label="Global min" value="0" min="0"
help= "A lower bound of the instrument m/z range."/>
<param name="global_max" type="float" label="Global max" value="1000" min="0"
help= "A higher bound of the instrument m/z range."/>
<param name="number_of_combinations" type="integer" label="Number of combinations"
help= "Combinations of how many series should be computed." value="5"/>
<param name="abundance_score_threshold" type="float" label="Abundance score threshold" value="100"
help= "A threshold for filtering abundance score parameter. The series with higher values are better."/>
<param name="peak_distance_threshold" type="float" label="Peak distance threshold" value="2"
help= "A threshold for the peak distance parameter. The closer this value is to 1, the better."/>
<param name="coverage_threshold" type="integer" label="How many % of the m/z range should be covered."
help= "How many % of the m/z range should be covered." value="90"/>
<param name="fill_series" type="boolean" truevalue="TRUE" falsevalue="FALSE" label="Whether to return top 10 unique series (TRUE) or series only from the best combination."
help= "If TRUE, top 10 unique series will be returned, otherwise only the series from the best
combination will be returned." value="false"/>
</xml>

<xml name="recal_param">
<param name="input_file" type="data" format="tabular" label="Input data (Output from MFAssign)"
help= "Input data frame, the output from MFAssign or MFAssignCHO"/>
Expand Down
31 changes: 11 additions & 20 deletions tools/mfassignr/mfassignr_findRecalSeries.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,44 @@
</edam_operations>
<expand macro="creator" />
<expand macro="refs" />

<expand macro="requirements" />

<command detect_errors="exit_code"><![CDATA[
Rscript -e 'packageVersion("MFAssignR")' &&
Rscript '${mfassignr_findrecalseries}'
]]>
</command>

<configfiles>
<configfile name="mfassignr_findrecalseries"><![CDATA[
library(dplyr)
df <- read.table("$input_file", header=TRUE, sep="\t")
result <- MFAssignR::FindRecalSeries(
df = df,
global_min = $global_min,
global_max = $global_max,
number_of_combinations = $number_of_combinations,
abundance_score_threshold = $abundance_score_threshold,
peak_distance_threshold = $peak_distance_threshold,
coverage_threshold = $coverage_threshold,
fill_series = $fill_series
) |> dplyr::rename(Series = series)
result <- MFAssignR::FindRecalSeriesSimple(df) |> dplyr::slice(-1)
write.table(result, file="$final_series", sep="\t", row.names=FALSE)
]]></configfile>
</configfiles>

<inputs>
<expand macro="findrecalseries_param"/>
<param name="input_file" type="data" format="tabular" label="Input data"
help="Recalibration series, output from RecalList"/>
</inputs>

<outputs>
<data name="final_series" format="tabular" label="Final recalibration series"/>
</outputs>

<tests>
<test>
<param name="input_file" value="recallist/recal_series.tabular"/>
<param name="global_min" value="100"/>
<param name="global_max" value="500"/>
<param name="abundance_score_threshold" value="50"/>
<param name="number_of_combinations" value="3"/>
<param name="coverage_threshold" value="50"/>
<param name="fill_series" value="TRUE"/>
<output name="final_series" file="findrecalseries/selected_series.tabular"/>
<output name="final_series" file="findrecalseries/selected_series_simple.tabular"/>
</test>
</tests>

<help>
@FINDRECALSERIES_HELP@

@GENERAL_HELP@
</help>

<expand macro="citations"/>
</tool>
4 changes: 2 additions & 2 deletions tools/mfassignr/mfassignr_recal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
<param name="isopeaks" value="isofiltr/iso_out.tabular"/>
<output name="Mono">
<assert_contents>
<has_n_lines n="9203"/>
<has_n_lines n="9156"/>
<has_n_columns n="3"/>
</assert_contents>
</output>
<output name="Iso">
<assert_contents>
<has_n_lines n="2474"/>
<has_n_lines n="2521"/>
<has_n_columns n="4"/>
</assert_contents>
</output>
Expand Down
4 changes: 2 additions & 2 deletions tools/mfassignr/mfassignr_snplot.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
df = read.delim("$input_file", sep="\t"),
cut = cut,
mass = $mass,
window.x = $window_x,
window.y = $window_y
mass_window = $window_x,
abundance_window = $window_y
)
ggplot2::ggsave(filename = "SNplot.png", SNplot)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"Series" "Number.Observed" "Series.Index" "Mass.Range" "Tall.Peak" "Abundance.Score" "Peak.Score" "Peak.Distance" "Series.Score" "Num_Weight" "Abund_weight" "TallP_Weight" "PeakS_Weight" "PeakD_Weight" "Series_Weight" "Total_score"
"O_H_7" 12 39 "131.049-299.236" 131.049175570564 172.333212266955 0.840925082711506 1 1.1 25 20 4.36830585235213 5.79537458644247 7 9.16666666666667 71.3303471054613
"O7_H_4" 11 40 "233.066-415.268" 359.206083268496 -11.5251682369853 0.136136287521764 1 1.3 22.9166666666667 -1.33754464219376 11.9735361089499 9.31931856239118 7 8.125 57.9969766958139
"O2_H_11" 5 78 "209.06-391.263" 223.074691790747 132.732152227999 0.540579659159889 1 2.8 10.4166666666667 15.4041290685615 7.43582305969157 7.29710170420056 7 6.08695652173913 53.6406770208594
"O6_H_7" 9 50 "253.071-407.242" 351.1796217 11.6976374801684 0.213201464774084 2 1.3 18.75 1.35756042915837 11.70598739 8.93399267612958 4 8.125 52.872540495288
"O10_H_3" 7 59 "381.175-465.268" 409.206584131861 2.6997318710302 0.0702879797813004 2 1 14.5833333333333 0.313315330865898 13.640219471062 9.6485601010935 4 10 52.1854282363548
"O10_H_4" 9 47 "309.081-491.284" 435.222060757962 4.7511651696338 0.655346847143645 2 1.6 18.75 0.551392863526961 14.5074020252654 6.72326576428178 4 7.27272727272727 51.8047879258014
"O9_H_6" 10 44 "303.07-499.289" 415.195395703443 -21.7793592335313 0.166622042493807 3 1.5 20.8333333333333 -2.52758698651699 13.8398465234481 9.16688978753096 1 7.5 49.8124826577954
"O8_H_1" 5 69 "213.061-311.169" 311.16936123622 27.8251864824375 0.198145538844287 1 1.6 10.4166666666667 3.22923087388803 10.3723120412073 9.00927230577856 7 7.27272727272727 47.3002091602679
"O9_H_9" 7 62 "339.071-479.226" 367.101864488525 -18.5226214411156 0.0271291741355916 2 1.6 14.5833333333333 -2.14962875669292 12.2367288162842 9.86435412932204 4 7.27272727272727 45.8075147949739
"O10_H_6" 6 66 "319.065-487.254" 431.190612941439 -34.0254140710475 0.137560981917351 1 2.2 12.5 -3.94879357536027 14.3730204313813 9.31219509041325 7 6.47058823529412 45.7070101817284
Loading

0 comments on commit 7d98b78

Please sign in to comment.