Snakemake tabular config

Multi tool use
I'm using Snakemake with a tabular configuration. This table is a bunch of rows that I first take out of a very large sample overview. The resulting sample.tsv has a lot of columns. I read the samples file like this, somewhere in my Snakefile:
samples = pd.read_table('samples.tsv').set_index('samples', drop=False)
When I run snakemake:
snakemake --cluster-config cluster.json --cluster "qsub -l nodes={cluster.nodes}:ppn={cluster.ppn}" --jobs 256
I get the following error:
16:51 nlv24077@kiato ~/temp/test_snakemake > run_snakemake.sh
Building DAG of jobs...
MissingInputException in line 6 of /home/nlv24077/temp/test_snakemake/rseqc.smk:
Missing input files for rule bam_stat:
analyzed/I7_index.STAR.genome.sorted.bam
the strange thing is that I7_index
is one of the column names in my samples table. Why is it using the column names as sample names?
Below I can show you part of the samples table (I can't show all data publicly):
Edit:
I was calling the samples like this:
rule bcl2fastq:
input:
config['bcl_dir']
output:
expand([os.path.join(fastq_dir, '{sample}_R1_001.fastq.gz'),
os.path.join(fastq_dir, '{sample}_R2_001.fastq.gz')],
sample=samples)
threads: 6
shell:
'''
# Run bcl2fastq
...
Whereas I should have used:
rule bcl2fastq:
input:
config['bcl_dir']
output:
expand([os.path.join(fastq_dir, '{sample}_R1_001.fastq.gz'),
os.path.join(fastq_dir, '{sample}_R2_001.fastq.gz')],
sample=samples['samples'])
threads: 6
shell:
'''
# Run bcl2fastq
...
Thanx JeeYem.
bioinformatics snakemake
|
show 3 more comments
I'm using Snakemake with a tabular configuration. This table is a bunch of rows that I first take out of a very large sample overview. The resulting sample.tsv has a lot of columns. I read the samples file like this, somewhere in my Snakefile:
samples = pd.read_table('samples.tsv').set_index('samples', drop=False)
When I run snakemake:
snakemake --cluster-config cluster.json --cluster "qsub -l nodes={cluster.nodes}:ppn={cluster.ppn}" --jobs 256
I get the following error:
16:51 nlv24077@kiato ~/temp/test_snakemake > run_snakemake.sh
Building DAG of jobs...
MissingInputException in line 6 of /home/nlv24077/temp/test_snakemake/rseqc.smk:
Missing input files for rule bam_stat:
analyzed/I7_index.STAR.genome.sorted.bam
the strange thing is that I7_index
is one of the column names in my samples table. Why is it using the column names as sample names?
Below I can show you part of the samples table (I can't show all data publicly):
Edit:
I was calling the samples like this:
rule bcl2fastq:
input:
config['bcl_dir']
output:
expand([os.path.join(fastq_dir, '{sample}_R1_001.fastq.gz'),
os.path.join(fastq_dir, '{sample}_R2_001.fastq.gz')],
sample=samples)
threads: 6
shell:
'''
# Run bcl2fastq
...
Whereas I should have used:
rule bcl2fastq:
input:
config['bcl_dir']
output:
expand([os.path.join(fastq_dir, '{sample}_R1_001.fastq.gz'),
os.path.join(fastq_dir, '{sample}_R2_001.fastq.gz')],
sample=samples['samples'])
threads: 6
shell:
'''
# Run bcl2fastq
...
Thanx JeeYem.
bioinformatics snakemake
Can you show the relevant code related to this error? For eg.,rule bam_stat
.
– JeeYem
Jan 2 at 16:51
1
ifsamples
column has the values of interest, are you sure you are using something likesamples['samples']
(orsamples.index.values
to row indices) to obtain them?
– JeeYem
Jan 2 at 23:26
Oh, is that necessary? I thought the idea was that as long as the index is your samples, you are fine and you can even address the metadata just by column name. But I just need to really address a certain column? Then setting the samples as index is also not necessary. How then can I call a metadata column, for example when the samples have different read lengths defined in the sample table? Thanx for your swift reply by the way!
– Freek
Jan 3 at 8:33
Ok, so indeed that works, I misunderstood what the samples table was used for, it seems to be pretty simple (one can extract lists from it). Now I wonder how I can address other columns, is it using pure python? Like samples[samples['samples']==sample]['read_length] to get one value? I'll try that at least.
– Freek
Jan 3 at 14:35
1
Please show relevant code. It's not easy to make sense of what exactly you are asking.
– JeeYem
Jan 3 at 16:01
|
show 3 more comments
I'm using Snakemake with a tabular configuration. This table is a bunch of rows that I first take out of a very large sample overview. The resulting sample.tsv has a lot of columns. I read the samples file like this, somewhere in my Snakefile:
samples = pd.read_table('samples.tsv').set_index('samples', drop=False)
When I run snakemake:
snakemake --cluster-config cluster.json --cluster "qsub -l nodes={cluster.nodes}:ppn={cluster.ppn}" --jobs 256
I get the following error:
16:51 nlv24077@kiato ~/temp/test_snakemake > run_snakemake.sh
Building DAG of jobs...
MissingInputException in line 6 of /home/nlv24077/temp/test_snakemake/rseqc.smk:
Missing input files for rule bam_stat:
analyzed/I7_index.STAR.genome.sorted.bam
the strange thing is that I7_index
is one of the column names in my samples table. Why is it using the column names as sample names?
Below I can show you part of the samples table (I can't show all data publicly):
Edit:
I was calling the samples like this:
rule bcl2fastq:
input:
config['bcl_dir']
output:
expand([os.path.join(fastq_dir, '{sample}_R1_001.fastq.gz'),
os.path.join(fastq_dir, '{sample}_R2_001.fastq.gz')],
sample=samples)
threads: 6
shell:
'''
# Run bcl2fastq
...
Whereas I should have used:
rule bcl2fastq:
input:
config['bcl_dir']
output:
expand([os.path.join(fastq_dir, '{sample}_R1_001.fastq.gz'),
os.path.join(fastq_dir, '{sample}_R2_001.fastq.gz')],
sample=samples['samples'])
threads: 6
shell:
'''
# Run bcl2fastq
...
Thanx JeeYem.
bioinformatics snakemake
I'm using Snakemake with a tabular configuration. This table is a bunch of rows that I first take out of a very large sample overview. The resulting sample.tsv has a lot of columns. I read the samples file like this, somewhere in my Snakefile:
samples = pd.read_table('samples.tsv').set_index('samples', drop=False)
When I run snakemake:
snakemake --cluster-config cluster.json --cluster "qsub -l nodes={cluster.nodes}:ppn={cluster.ppn}" --jobs 256
I get the following error:
16:51 nlv24077@kiato ~/temp/test_snakemake > run_snakemake.sh
Building DAG of jobs...
MissingInputException in line 6 of /home/nlv24077/temp/test_snakemake/rseqc.smk:
Missing input files for rule bam_stat:
analyzed/I7_index.STAR.genome.sorted.bam
the strange thing is that I7_index
is one of the column names in my samples table. Why is it using the column names as sample names?
Below I can show you part of the samples table (I can't show all data publicly):
Edit:
I was calling the samples like this:
rule bcl2fastq:
input:
config['bcl_dir']
output:
expand([os.path.join(fastq_dir, '{sample}_R1_001.fastq.gz'),
os.path.join(fastq_dir, '{sample}_R2_001.fastq.gz')],
sample=samples)
threads: 6
shell:
'''
# Run bcl2fastq
...
Whereas I should have used:
rule bcl2fastq:
input:
config['bcl_dir']
output:
expand([os.path.join(fastq_dir, '{sample}_R1_001.fastq.gz'),
os.path.join(fastq_dir, '{sample}_R2_001.fastq.gz')],
sample=samples['samples'])
threads: 6
shell:
'''
# Run bcl2fastq
...
Thanx JeeYem.
bioinformatics snakemake
bioinformatics snakemake
edited Jan 4 at 12:50
Freek
asked Jan 2 at 16:00
FreekFreek
3881418
3881418
Can you show the relevant code related to this error? For eg.,rule bam_stat
.
– JeeYem
Jan 2 at 16:51
1
ifsamples
column has the values of interest, are you sure you are using something likesamples['samples']
(orsamples.index.values
to row indices) to obtain them?
– JeeYem
Jan 2 at 23:26
Oh, is that necessary? I thought the idea was that as long as the index is your samples, you are fine and you can even address the metadata just by column name. But I just need to really address a certain column? Then setting the samples as index is also not necessary. How then can I call a metadata column, for example when the samples have different read lengths defined in the sample table? Thanx for your swift reply by the way!
– Freek
Jan 3 at 8:33
Ok, so indeed that works, I misunderstood what the samples table was used for, it seems to be pretty simple (one can extract lists from it). Now I wonder how I can address other columns, is it using pure python? Like samples[samples['samples']==sample]['read_length] to get one value? I'll try that at least.
– Freek
Jan 3 at 14:35
1
Please show relevant code. It's not easy to make sense of what exactly you are asking.
– JeeYem
Jan 3 at 16:01
|
show 3 more comments
Can you show the relevant code related to this error? For eg.,rule bam_stat
.
– JeeYem
Jan 2 at 16:51
1
ifsamples
column has the values of interest, are you sure you are using something likesamples['samples']
(orsamples.index.values
to row indices) to obtain them?
– JeeYem
Jan 2 at 23:26
Oh, is that necessary? I thought the idea was that as long as the index is your samples, you are fine and you can even address the metadata just by column name. But I just need to really address a certain column? Then setting the samples as index is also not necessary. How then can I call a metadata column, for example when the samples have different read lengths defined in the sample table? Thanx for your swift reply by the way!
– Freek
Jan 3 at 8:33
Ok, so indeed that works, I misunderstood what the samples table was used for, it seems to be pretty simple (one can extract lists from it). Now I wonder how I can address other columns, is it using pure python? Like samples[samples['samples']==sample]['read_length] to get one value? I'll try that at least.
– Freek
Jan 3 at 14:35
1
Please show relevant code. It's not easy to make sense of what exactly you are asking.
– JeeYem
Jan 3 at 16:01
Can you show the relevant code related to this error? For eg.,
rule bam_stat
.– JeeYem
Jan 2 at 16:51
Can you show the relevant code related to this error? For eg.,
rule bam_stat
.– JeeYem
Jan 2 at 16:51
1
1
if
samples
column has the values of interest, are you sure you are using something like samples['samples']
(or samples.index.values
to row indices) to obtain them?– JeeYem
Jan 2 at 23:26
if
samples
column has the values of interest, are you sure you are using something like samples['samples']
(or samples.index.values
to row indices) to obtain them?– JeeYem
Jan 2 at 23:26
Oh, is that necessary? I thought the idea was that as long as the index is your samples, you are fine and you can even address the metadata just by column name. But I just need to really address a certain column? Then setting the samples as index is also not necessary. How then can I call a metadata column, for example when the samples have different read lengths defined in the sample table? Thanx for your swift reply by the way!
– Freek
Jan 3 at 8:33
Oh, is that necessary? I thought the idea was that as long as the index is your samples, you are fine and you can even address the metadata just by column name. But I just need to really address a certain column? Then setting the samples as index is also not necessary. How then can I call a metadata column, for example when the samples have different read lengths defined in the sample table? Thanx for your swift reply by the way!
– Freek
Jan 3 at 8:33
Ok, so indeed that works, I misunderstood what the samples table was used for, it seems to be pretty simple (one can extract lists from it). Now I wonder how I can address other columns, is it using pure python? Like samples[samples['samples']==sample]['read_length] to get one value? I'll try that at least.
– Freek
Jan 3 at 14:35
Ok, so indeed that works, I misunderstood what the samples table was used for, it seems to be pretty simple (one can extract lists from it). Now I wonder how I can address other columns, is it using pure python? Like samples[samples['samples']==sample]['read_length] to get one value? I'll try that at least.
– Freek
Jan 3 at 14:35
1
1
Please show relevant code. It's not easy to make sense of what exactly you are asking.
– JeeYem
Jan 3 at 16:01
Please show relevant code. It's not easy to make sense of what exactly you are asking.
– JeeYem
Jan 3 at 16:01
|
show 3 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54009421%2fsnakemake-tabular-config%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54009421%2fsnakemake-tabular-config%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4OnYaqpEZL4X2IjjvqY UB5J4TgoYomho9 QBnUjvTTMt6yKm5v4Wi,c IyyLaQ,KStcGH,SGX3ieEu4 99a,gq nYn
Can you show the relevant code related to this error? For eg.,
rule bam_stat
.– JeeYem
Jan 2 at 16:51
1
if
samples
column has the values of interest, are you sure you are using something likesamples['samples']
(orsamples.index.values
to row indices) to obtain them?– JeeYem
Jan 2 at 23:26
Oh, is that necessary? I thought the idea was that as long as the index is your samples, you are fine and you can even address the metadata just by column name. But I just need to really address a certain column? Then setting the samples as index is also not necessary. How then can I call a metadata column, for example when the samples have different read lengths defined in the sample table? Thanx for your swift reply by the way!
– Freek
Jan 3 at 8:33
Ok, so indeed that works, I misunderstood what the samples table was used for, it seems to be pretty simple (one can extract lists from it). Now I wonder how I can address other columns, is it using pure python? Like samples[samples['samples']==sample]['read_length] to get one value? I'll try that at least.
– Freek
Jan 3 at 14:35
1
Please show relevant code. It's not easy to make sense of what exactly you are asking.
– JeeYem
Jan 3 at 16:01