-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrapper.py #7
base: develop
Are you sure you want to change the base?
Wrapper.py #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good overall. I think it can be made somewhat better with some argparse tricks.
Could you add the new command to the testing instead of the bash command?
parser.add_argument('-if', '--inc-fr', help='including fr1. Default = - ', default="-") | ||
parser.add_argument('func_filter', help='functionality filter input. Options: productive, unproductive, ' | ||
'remove_unknown') | ||
parser.add_argument('unique', help='Options: "VGene,CDR3.IMGT.AA,best_match_class", "VGene,CDR3.IMGT.AA", ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argparse has a choices
option that allows you to set strictly available options. These should be available in the help output.
parser.add_argument('-noe', '--naive-output-ce', help=' input naive ce: options path to output history ', default='XXX') | ||
parser.add_argument('-nol', '--naive-output-all', help=' input naive all: options path to output history ', | ||
default='XXX') | ||
parser.add_argument('filter_unique', help='input for unique filter. Options: remove, remove_vjaa, keep, no') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here for choices
default='XXX') | ||
parser.add_argument('filter_unique', help='input for unique filter. Options: remove, remove_vjaa, keep, no') | ||
parser.add_argument('-uc', '--unique-count', help='input for the unique count. Default=2', default='2') | ||
parser.add_argument('class_filter', help='input for class filter. Options: 70_70, 60_55, 70_0, 60_0, 19_0, ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here for choices
parser.add_argument('class_filter', help='input for class filter. Options: 70_70, 60_55, 70_0, 60_0, 19_0, ' | ||
'101_101 ') | ||
parser.add_argument('region_filter', help='input for region filter. Options: leader, CDR1, FR1, FR2') | ||
parser.add_argument('-fa', '--fast', help='input fast process. input: yes, no. Default=no', default='no') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a boolean flag. Look at the argparse documentation for store_true
or store_const
. This way you can use --fast
to set the argument to 'yes' or 'no' without using --fast no
.
'"productive CDR3.IMGT.AA,best_match_class", "CDR3.IMGT.AA", "VGene,' | ||
'CDR3.IMGT.seq,best_match_class", "VGene,CDR3.IMGT.seq",' | ||
' "CDR3.IMGT.seq,best_match_class", "CDR3.IMGT.seq", Sequence.ID ') | ||
parser.add_argument('-no', '--naive-output', help='New IMGT archives per class in history. Option: no, yes. Default=no', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment below about storing constants and boolean flags.
parser.add_argument('result_html', help='Path of the output file') | ||
parser.add_argument('result_dir', help='Path where the results will be stored') | ||
parser.add_argument('title', help='Specify the title for the run') | ||
parser.add_argument('-if', '--inc-fr', help='including fr1. Default = - ', default="-") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the available options here? Were you able to figure that out?
It looks like it has something to do with the inclusion of the FR1 region.
Maybe this is an argument that is skipped in wrapper.sh
? Not all arguments are used I think.
args = parser.parse_args() | ||
|
||
|
||
subprocess.call(["bash", "wrapper.sh", args.input, args.method, args.result_html, args.result_dir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"wrapper.sh"
Might not be in the current working directory. If galaxy executes the tool it is not, because the working directory is separate from the output directory. You need to find a way to always execute the wrapper.sh script that is in the same directory as this wrapper.py script.
calling wrapper.sh with:
bash wrapper.sh tests/data/CONTROL_NWK377_PB_IGHC_MID1_40nt_2.txz custom $PWD/results/output.html $PWD/results "CONTROL_NWK377_PB_IGHC_MID1_40nt_2.txz" "-" productive Sequence.ID no XXXX XXXX XXXX XXXX XXXX remove 2 70_70 FR1 no
can now be done using wrapper.py and folowwing input:
python wrapper.py tests/data/CONTROL_NWK377_PB_IGHC_MID1_40nt_2.txz $PWD/results/output.html $PWD/results "CONTROL_NWK377_PB_IGHC_MID1_40nt_2.txz" productive Sequence.ID remove 70_70 FR1