bash

Is there a way to introduce a temporary wildcard in Snakemake from a list?

Is there a way to introduce a temporary wildcard in Snakemake from a list? Question: I recently started using Snakemake. I am building a pipeline where the goal is to separate fractions of reads (based on their taxID by classification by Kraken2). I am having problems understanding how I may introduce a new wildcard based …

Total answers: 1

Raise Airflow Exception to Fail Task from CURL request

Raise Airflow Exception to Fail Task from CURL request Question: I am using airflow to schedule and automate Python scripts housed on a Ubuntu server. The DAG triggers a CURL request that hits a Flask API on the same machine which actually runs the script. Here is a high level overview of the flow: Airflow …

Total answers: 1

Updating python variable name using Sed in shell script

Updating python variable name using Sed in shell script Question: I have a py file where we need to update the value of a variable table_name from a shell script using sed. The value will be like $ENV_NAME_ref_table considering we have already exported ENV_NAME as export ENV_NAME=’staging’. What should be the sed command? I have …

Total answers: 1

How to run bash script with getopt included in python?

How to run bash script with getopt included in python? Question: I am running a script in the ubuntu terminal and it works fine. ./run_script2.sh -b ./exercises/13_caching.py I want to run the same script in python os or subprocess but I am getting an error : ./run_script2.sh: line 36: getopt: command not found On line …

Total answers: 1

How to extract a key value from json file (python)

How to extract a key value from json file (python) Question: I’m trying to write a program that extracts all labels from a given JSON file: {"menu": { "header": "SVG Viewer", "items": [ {"id": "Open"}, {"id": "OpenNew", "label": "Open New"}, null, {"id": "ZoomIn", "label": "Zoom In"}, {"id": "ZoomOut", "label": "Zoom Out"}, {"id": "OriginalView", "label": "Original …

Total answers: 3

Pylint `–good-names` syntax on Linux

Pylint `–good-names` syntax on Linux Question: I’ve been using PyLint in Windows with such configuration: pylint –good-names (‘i’,’el’,’of’,’df’,’pd’,’Entity’) –bad-names (‘foo’,’bar’,’kek’,’KEK’) module but on Ubuntu, I get an exception while trying to parse good-names arguments (‘i’,’el’, …): /bin/bash: -c: line 6: syntax error near unexpected token `(‘ What is the correct way to provide such uncommon …

Total answers: 1

Writing to File descriptor 0 (STDIN) only affects terminal. Program doesn't read

Writing to File descriptor 0 (STDIN) only affects terminal. Program doesn't read Question: I’m studying file descriptors and I’m trying to simulate an input for FD 0 (STDIN). I’m testing in a linux environment. My intention is to write, via terminal, simulating an standard input to the code Here is my python code: import sys …

Total answers: 1