Questions tagged [wildcard-expansion]

Wildcard expansion is the process of pattern matching by treating a special wildcard character as a replaceable segment of the pattern.

Wildcard expansion, or globbing in a UNIX context, is a common technique of extracting a set of values that match a simple pattern. The wildcard character stands in for a sequence of potentially variable character that the pattern is not concerned with.

Wildcards typically use the following characters: ?, *, or %.

Depending on the context these can mean different things, but typically ? matches a single character, and * or % match zero or more characters. The specific set wildcard characters accepted vary with the application.

Wildcard expansion is related to regular expressions but should not be confused with them as they are very distinct entities.

51 questions
2
votes
2 answers

Wrong snakemake glob_wilcards and wildcard_constraints

Within my snakemake pipeline I'm trying to retrieve the correct wildcards. I've looked into wildcard_constraints and this post and this post, however I can't figure out the exact solution. Here's an example of file names within 2 datasets. 1 dataset…
manvenk
  • 69
  • 6
2
votes
1 answer

improve snakemake rule in few aspects

I have a rule of which I use a loop in the shell parameter. Not sure if this is snakemake's best practice to utilize loops in the shell section. Perhaps someone could tell me whether or not this is the case. I also produce many files from such rules…
moth
  • 1,833
  • 12
  • 29
2
votes
1 answer

snakemake: specify file obtained by glob_wildcards

How can I specify the file obtained by glob_wildcards? Suppose I have sample1.txt, sample2.txt, sample3.txt, and sample4.txt are in the same directory. The following code is just an example: FILES = glob_wildcards("data/{sample}.txt") SAMPLES =…
mimi
  • 61
  • 4
2
votes
1 answer

How to use wildcards in keyword wildcard_constraints

For example, I have the following wildcards. dataset = ['A1', 'A2', 'A3', 'B1', 'B2', 'B3'] group = ['A', 'B'] I am trying to contrain my dataset with my group. for example, I want to create A1/file.A.txt A2/file.A.txt A3/file.A.txt B1/file.B.txt…
qingyuanfl
  • 33
  • 5
2
votes
1 answer

"set -f" in bash not working

Related: Stop shell wildcard character expansion? I had in the past used set -f in bash to prevent glob expansion - however this seems to not work on my mac any more: $ cat script.sh #!/bin/bash echo $0 i=1 for var in $@ do echo "$i => $var" …
Aleks G
  • 56,435
  • 29
  • 168
  • 265
2
votes
1 answer

How to use wild card in admin routing in laravel 5

I am using code that is below for admin routing in laravel. Route::group(['prefix' => 'admin'], function() { Route::get('/', 'Admin\AdminController@home'); Route::get('/users/userList', 'Admin\UserController@userList'); Route::get('/users/detail',…
1
vote
2 answers

Is there a function in snakemake to make the list of output dependent on the arguments passed into the shell command

I have a snakemake rule that calls a python program, the output of the python program is dependent on the arguments passed. I would like to make snakemake aware of the differences between the expected output when a certain parameter is passed…
1
vote
2 answers

Use a shell script to obtain a params for every wildcard

I have an R script in my workflow that requires the number of entries on several csv files (a.csv, b.csv, c.csv; formatted with headers) as a value. Since they all have a string something in every line, I thought I could write the rule as…
Giulio Centorame
  • 678
  • 4
  • 19
1
vote
1 answer

How to use Snakemake "allow_missing"=True properly? Partial wild_cards?

I have a list of input files that are in different subfolders and each folder have different number of files, with two wildcards SAMPLE and id. For the output, these names will also be present: SAMPLE=set(["x","y","z"]) with…
P.Yuan
  • 23
  • 2
1
vote
1 answer

Using expand to concatenate .tab files in subdirectories which are variables themselves

I have two variables and I would like to concatenate all .tab files for "BOB" and "LISA" separately. How to do this in snakemake? With expand like below it is concatenating all tab files for both BOB and LISA…
user3224522
  • 1,119
  • 8
  • 19
1
vote
1 answer

Generate many files with wildcard, then merge into one

I have two rules on my Snakefile: one generates several sets of files using wildcards, the other one merges everything into a single file. This is how I wrote it: chr = range(1,23) rule generate: input: og_files = config["tmp"] +…
Giulio Centorame
  • 678
  • 4
  • 19
1
vote
1 answer

lsblk -n -o NAME,SIZE,TYPE /dev/sd* 2>/dev/null works on cmd line, not in script file

I am writing a script to detect and format USB drives for Raspberry Pi. I got the script to work perfectly for sd cards inserted via a USB adapter. It failed when I tried a usb3 HDD. Isolating the failure indicates a problem with wildcard expansion…
1
vote
1 answer

Python Pandas Regex: Search for strings with a wildcard in a column and return matches

I have a search list in a column which may contain a key: 'keyword1*keyword2' to try to find the match in a separate dataframe column. How can I include the regex wildcard type 'keyword1.*keyword2' #using str.extract, extractall or findall? Using…
lodestar08
  • 21
  • 1
  • 5
1
vote
1 answer

Case-normalize filenames based on wildcard patterns

How can I case-normalize filenames based on the literal components of matching wildcard patterns? Consider the following filenames: ABC_1232.txt abC_4321.Txt qwerty_1232.cSv QwErTY_4321.CsV They all match the following wildcard…
mklement0
  • 382,024
  • 64
  • 607
  • 775
1
vote
4 answers

Can snakemake config parameter values be strings with {} values to be interpolated/expanded?

Is there a way to define a snakemake config string in a .yaml file so that it can contain {wildcard} and {param} values, and when that string is used in a shell command, the {} values are substituted with the actual value of ""? For…
tedtoal
  • 1,030
  • 1
  • 10
  • 22