Snakefile and wildcard/regex for Output file naming
In a snakemake bioinformatics workflow aimed at mapping long reads, input fastq data could have a range of possible file extensions depending on user preference and file compression format (e.g. I expect to observed both sequence.fastq
or sequence.fq.gz
). Wildcards can be used to select for the input files - I am having a challenge with the naming of output files. In a single workflow I am expecting that we could see samples that are uncompressed, gzipped and bzip2 compressed.
Is there a recommended way for stripping the file extension such that the output of a mapping could be sequence.bam
rather than the excessive sequence.fq.gz.bam
?
Any hints would be very gratefully received - thanks S
snakemake
add a comment |
In a snakemake bioinformatics workflow aimed at mapping long reads, input fastq data could have a range of possible file extensions depending on user preference and file compression format (e.g. I expect to observed both sequence.fastq
or sequence.fq.gz
). Wildcards can be used to select for the input files - I am having a challenge with the naming of output files. In a single workflow I am expecting that we could see samples that are uncompressed, gzipped and bzip2 compressed.
Is there a recommended way for stripping the file extension such that the output of a mapping could be sequence.bam
rather than the excessive sequence.fq.gz.bam
?
Any hints would be very gratefully received - thanks S
snakemake
Show your Minimal, Complete, and Verifiable example so potential answers have some context. Maybe edit the question and make it fit the expected format: what are you trying to do, what did you try, and what results did you get.
– jdv
Nov 19 '18 at 17:30
add a comment |
In a snakemake bioinformatics workflow aimed at mapping long reads, input fastq data could have a range of possible file extensions depending on user preference and file compression format (e.g. I expect to observed both sequence.fastq
or sequence.fq.gz
). Wildcards can be used to select for the input files - I am having a challenge with the naming of output files. In a single workflow I am expecting that we could see samples that are uncompressed, gzipped and bzip2 compressed.
Is there a recommended way for stripping the file extension such that the output of a mapping could be sequence.bam
rather than the excessive sequence.fq.gz.bam
?
Any hints would be very gratefully received - thanks S
snakemake
In a snakemake bioinformatics workflow aimed at mapping long reads, input fastq data could have a range of possible file extensions depending on user preference and file compression format (e.g. I expect to observed both sequence.fastq
or sequence.fq.gz
). Wildcards can be used to select for the input files - I am having a challenge with the naming of output files. In a single workflow I am expecting that we could see samples that are uncompressed, gzipped and bzip2 compressed.
Is there a recommended way for stripping the file extension such that the output of a mapping could be sequence.bam
rather than the excessive sequence.fq.gz.bam
?
Any hints would be very gratefully received - thanks S
snakemake
snakemake
asked Nov 19 '18 at 17:14
Stephen RuddStephen Rudd
1
1
Show your Minimal, Complete, and Verifiable example so potential answers have some context. Maybe edit the question and make it fit the expected format: what are you trying to do, what did you try, and what results did you get.
– jdv
Nov 19 '18 at 17:30
add a comment |
Show your Minimal, Complete, and Verifiable example so potential answers have some context. Maybe edit the question and make it fit the expected format: what are you trying to do, what did you try, and what results did you get.
– jdv
Nov 19 '18 at 17:30
Show your Minimal, Complete, and Verifiable example so potential answers have some context. Maybe edit the question and make it fit the expected format: what are you trying to do, what did you try, and what results did you get.
– jdv
Nov 19 '18 at 17:30
Show your Minimal, Complete, and Verifiable example so potential answers have some context. Maybe edit the question and make it fit the expected format: what are you trying to do, what did you try, and what results did you get.
– jdv
Nov 19 '18 at 17:30
add a comment |
1 Answer
1
active
oldest
votes
There are a few ways of doing this. One way without the need for regex but under the naming standard that the sequence id and extension are separated by a single dot is using split only on first occurence. For example, if you had filename in which there are two identifiers or more separated with a .
(e.g. {sequence_id1}.{sequence_id2}.{extension}
) you would have to use regex but the logic is similar to below.
You can test this example by creating an input directory with the following files:
$ mkdir input
$ for i in 1 2 3;do touch input/sequence"$i";done
$ for i in 4 5 6;do touch input/sequence"$i".gz;done
$ for i in 7 8 9;do touch input/sequence"$i".fq.gz;done
$ for i in 10 11 12;do touch input/sequence"$i".bzip;done
The following Snakefile implementation would do what you require and would allow performing different actions depending on whether there is an extension and what type of extension it is:
###Snakefile
# Get all filenames in a specific input directory
wildcards = glob_wildcards('input/{fq_files}')
# Split the filenames into basename and extension
files = [filename.split('.', 1) for filename in wildcards.fq_files]
# Create a dictionary of mapping basename:extension
file_dict = {filename[0]: filename[1] if len(
filename) == 2 else '' for filename in files}
rule all:
input:
expand('output/{seqid}.bam', seqid=file_dict.keys()),
rule generate_bams:
input:
lambda wc: f'input/{{seqid}}.{file_dict[wc.seqid]}' if file_dict[wc.seqid] != '' else 'input/{seqid}',
output: 'output/{seqid}.bam',
run:
if (file_dict[wildcards.seqid] == 'gz'):
shell(
'echo "FILENAME = {input}nFile has gz in filename" > {output}')
elif (file_dict[wildcards.seqid] == 'fq.gz'):
shell(
'echo "FILENAME = {input}nFile has fq.gz in filename" > {output}')
elif (file_dict[wildcards.seqid] == 'bzip'):
shell(
'echo "FILENAME = {input}nFile has bzip in filename" > {output}')
else:
shell(
'echo "FILENAME = {input}nFile has no extension in filename" > {output}')
Since glob_wildcards
will not keep the extension to basename mapping, you can split the filename and create a basename:extension mapping. After creating this dictionary, you can always access it during input and params specification or run/shell directives. You can do similar with regex by changing the split part into a regex and obtaining the matching groups.
I am using Python 3.6 and if you have Python that is below 3.6 you can change the string literal portion:
lambda wc: f'input/{{seqid}}.{file_dict[wc.seqid]}' if file_dict[wc.seqid] != '' else 'input/{seqid}',
to:
lambda wc: 'input/{{seqid}}.{0}'.format(file_dict[wc.seqid]) if file_dict[wc.seqid] != '' else 'input/{seqid}',
So if there are filenames w/o extensions or with various extensions you can account for them using glob_wilcards
, split
and a dictionary for storing the basename:extension mapping.
In the future you should try to provide example input, output and if not a working example at least what you tried.
EDIT
I assumed that you do not have same sequence names with different extensions. If you do want to account for that as well, you can map a sequence name to multiple extensions. You can do this by changing:
### Create a dictionary of mapping basename:extension
# file_dict = {filename[0]: filename[1] if len(
# filename) == 2 else '' for filename in files}
### Creata dictionary of mapping basename: [extensions]
file_dict = {}
for filename in files:
if len(filename) == 2:
file_dict.setdefault(filename[0],).append(filename[1])
else:
file_dict.setdefault(filename[0],).append('')
print(file_dict)
Doing this you would also need to change the lambda function to a for loop or list comprehension in the input
directive and change the conditions in if/elif(condition)
.
add a comment |
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%2f53379629%2fsnakefile-and-wildcard-regex-for-output-file-naming%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are a few ways of doing this. One way without the need for regex but under the naming standard that the sequence id and extension are separated by a single dot is using split only on first occurence. For example, if you had filename in which there are two identifiers or more separated with a .
(e.g. {sequence_id1}.{sequence_id2}.{extension}
) you would have to use regex but the logic is similar to below.
You can test this example by creating an input directory with the following files:
$ mkdir input
$ for i in 1 2 3;do touch input/sequence"$i";done
$ for i in 4 5 6;do touch input/sequence"$i".gz;done
$ for i in 7 8 9;do touch input/sequence"$i".fq.gz;done
$ for i in 10 11 12;do touch input/sequence"$i".bzip;done
The following Snakefile implementation would do what you require and would allow performing different actions depending on whether there is an extension and what type of extension it is:
###Snakefile
# Get all filenames in a specific input directory
wildcards = glob_wildcards('input/{fq_files}')
# Split the filenames into basename and extension
files = [filename.split('.', 1) for filename in wildcards.fq_files]
# Create a dictionary of mapping basename:extension
file_dict = {filename[0]: filename[1] if len(
filename) == 2 else '' for filename in files}
rule all:
input:
expand('output/{seqid}.bam', seqid=file_dict.keys()),
rule generate_bams:
input:
lambda wc: f'input/{{seqid}}.{file_dict[wc.seqid]}' if file_dict[wc.seqid] != '' else 'input/{seqid}',
output: 'output/{seqid}.bam',
run:
if (file_dict[wildcards.seqid] == 'gz'):
shell(
'echo "FILENAME = {input}nFile has gz in filename" > {output}')
elif (file_dict[wildcards.seqid] == 'fq.gz'):
shell(
'echo "FILENAME = {input}nFile has fq.gz in filename" > {output}')
elif (file_dict[wildcards.seqid] == 'bzip'):
shell(
'echo "FILENAME = {input}nFile has bzip in filename" > {output}')
else:
shell(
'echo "FILENAME = {input}nFile has no extension in filename" > {output}')
Since glob_wildcards
will not keep the extension to basename mapping, you can split the filename and create a basename:extension mapping. After creating this dictionary, you can always access it during input and params specification or run/shell directives. You can do similar with regex by changing the split part into a regex and obtaining the matching groups.
I am using Python 3.6 and if you have Python that is below 3.6 you can change the string literal portion:
lambda wc: f'input/{{seqid}}.{file_dict[wc.seqid]}' if file_dict[wc.seqid] != '' else 'input/{seqid}',
to:
lambda wc: 'input/{{seqid}}.{0}'.format(file_dict[wc.seqid]) if file_dict[wc.seqid] != '' else 'input/{seqid}',
So if there are filenames w/o extensions or with various extensions you can account for them using glob_wilcards
, split
and a dictionary for storing the basename:extension mapping.
In the future you should try to provide example input, output and if not a working example at least what you tried.
EDIT
I assumed that you do not have same sequence names with different extensions. If you do want to account for that as well, you can map a sequence name to multiple extensions. You can do this by changing:
### Create a dictionary of mapping basename:extension
# file_dict = {filename[0]: filename[1] if len(
# filename) == 2 else '' for filename in files}
### Creata dictionary of mapping basename: [extensions]
file_dict = {}
for filename in files:
if len(filename) == 2:
file_dict.setdefault(filename[0],).append(filename[1])
else:
file_dict.setdefault(filename[0],).append('')
print(file_dict)
Doing this you would also need to change the lambda function to a for loop or list comprehension in the input
directive and change the conditions in if/elif(condition)
.
add a comment |
There are a few ways of doing this. One way without the need for regex but under the naming standard that the sequence id and extension are separated by a single dot is using split only on first occurence. For example, if you had filename in which there are two identifiers or more separated with a .
(e.g. {sequence_id1}.{sequence_id2}.{extension}
) you would have to use regex but the logic is similar to below.
You can test this example by creating an input directory with the following files:
$ mkdir input
$ for i in 1 2 3;do touch input/sequence"$i";done
$ for i in 4 5 6;do touch input/sequence"$i".gz;done
$ for i in 7 8 9;do touch input/sequence"$i".fq.gz;done
$ for i in 10 11 12;do touch input/sequence"$i".bzip;done
The following Snakefile implementation would do what you require and would allow performing different actions depending on whether there is an extension and what type of extension it is:
###Snakefile
# Get all filenames in a specific input directory
wildcards = glob_wildcards('input/{fq_files}')
# Split the filenames into basename and extension
files = [filename.split('.', 1) for filename in wildcards.fq_files]
# Create a dictionary of mapping basename:extension
file_dict = {filename[0]: filename[1] if len(
filename) == 2 else '' for filename in files}
rule all:
input:
expand('output/{seqid}.bam', seqid=file_dict.keys()),
rule generate_bams:
input:
lambda wc: f'input/{{seqid}}.{file_dict[wc.seqid]}' if file_dict[wc.seqid] != '' else 'input/{seqid}',
output: 'output/{seqid}.bam',
run:
if (file_dict[wildcards.seqid] == 'gz'):
shell(
'echo "FILENAME = {input}nFile has gz in filename" > {output}')
elif (file_dict[wildcards.seqid] == 'fq.gz'):
shell(
'echo "FILENAME = {input}nFile has fq.gz in filename" > {output}')
elif (file_dict[wildcards.seqid] == 'bzip'):
shell(
'echo "FILENAME = {input}nFile has bzip in filename" > {output}')
else:
shell(
'echo "FILENAME = {input}nFile has no extension in filename" > {output}')
Since glob_wildcards
will not keep the extension to basename mapping, you can split the filename and create a basename:extension mapping. After creating this dictionary, you can always access it during input and params specification or run/shell directives. You can do similar with regex by changing the split part into a regex and obtaining the matching groups.
I am using Python 3.6 and if you have Python that is below 3.6 you can change the string literal portion:
lambda wc: f'input/{{seqid}}.{file_dict[wc.seqid]}' if file_dict[wc.seqid] != '' else 'input/{seqid}',
to:
lambda wc: 'input/{{seqid}}.{0}'.format(file_dict[wc.seqid]) if file_dict[wc.seqid] != '' else 'input/{seqid}',
So if there are filenames w/o extensions or with various extensions you can account for them using glob_wilcards
, split
and a dictionary for storing the basename:extension mapping.
In the future you should try to provide example input, output and if not a working example at least what you tried.
EDIT
I assumed that you do not have same sequence names with different extensions. If you do want to account for that as well, you can map a sequence name to multiple extensions. You can do this by changing:
### Create a dictionary of mapping basename:extension
# file_dict = {filename[0]: filename[1] if len(
# filename) == 2 else '' for filename in files}
### Creata dictionary of mapping basename: [extensions]
file_dict = {}
for filename in files:
if len(filename) == 2:
file_dict.setdefault(filename[0],).append(filename[1])
else:
file_dict.setdefault(filename[0],).append('')
print(file_dict)
Doing this you would also need to change the lambda function to a for loop or list comprehension in the input
directive and change the conditions in if/elif(condition)
.
add a comment |
There are a few ways of doing this. One way without the need for regex but under the naming standard that the sequence id and extension are separated by a single dot is using split only on first occurence. For example, if you had filename in which there are two identifiers or more separated with a .
(e.g. {sequence_id1}.{sequence_id2}.{extension}
) you would have to use regex but the logic is similar to below.
You can test this example by creating an input directory with the following files:
$ mkdir input
$ for i in 1 2 3;do touch input/sequence"$i";done
$ for i in 4 5 6;do touch input/sequence"$i".gz;done
$ for i in 7 8 9;do touch input/sequence"$i".fq.gz;done
$ for i in 10 11 12;do touch input/sequence"$i".bzip;done
The following Snakefile implementation would do what you require and would allow performing different actions depending on whether there is an extension and what type of extension it is:
###Snakefile
# Get all filenames in a specific input directory
wildcards = glob_wildcards('input/{fq_files}')
# Split the filenames into basename and extension
files = [filename.split('.', 1) for filename in wildcards.fq_files]
# Create a dictionary of mapping basename:extension
file_dict = {filename[0]: filename[1] if len(
filename) == 2 else '' for filename in files}
rule all:
input:
expand('output/{seqid}.bam', seqid=file_dict.keys()),
rule generate_bams:
input:
lambda wc: f'input/{{seqid}}.{file_dict[wc.seqid]}' if file_dict[wc.seqid] != '' else 'input/{seqid}',
output: 'output/{seqid}.bam',
run:
if (file_dict[wildcards.seqid] == 'gz'):
shell(
'echo "FILENAME = {input}nFile has gz in filename" > {output}')
elif (file_dict[wildcards.seqid] == 'fq.gz'):
shell(
'echo "FILENAME = {input}nFile has fq.gz in filename" > {output}')
elif (file_dict[wildcards.seqid] == 'bzip'):
shell(
'echo "FILENAME = {input}nFile has bzip in filename" > {output}')
else:
shell(
'echo "FILENAME = {input}nFile has no extension in filename" > {output}')
Since glob_wildcards
will not keep the extension to basename mapping, you can split the filename and create a basename:extension mapping. After creating this dictionary, you can always access it during input and params specification or run/shell directives. You can do similar with regex by changing the split part into a regex and obtaining the matching groups.
I am using Python 3.6 and if you have Python that is below 3.6 you can change the string literal portion:
lambda wc: f'input/{{seqid}}.{file_dict[wc.seqid]}' if file_dict[wc.seqid] != '' else 'input/{seqid}',
to:
lambda wc: 'input/{{seqid}}.{0}'.format(file_dict[wc.seqid]) if file_dict[wc.seqid] != '' else 'input/{seqid}',
So if there are filenames w/o extensions or with various extensions you can account for them using glob_wilcards
, split
and a dictionary for storing the basename:extension mapping.
In the future you should try to provide example input, output and if not a working example at least what you tried.
EDIT
I assumed that you do not have same sequence names with different extensions. If you do want to account for that as well, you can map a sequence name to multiple extensions. You can do this by changing:
### Create a dictionary of mapping basename:extension
# file_dict = {filename[0]: filename[1] if len(
# filename) == 2 else '' for filename in files}
### Creata dictionary of mapping basename: [extensions]
file_dict = {}
for filename in files:
if len(filename) == 2:
file_dict.setdefault(filename[0],).append(filename[1])
else:
file_dict.setdefault(filename[0],).append('')
print(file_dict)
Doing this you would also need to change the lambda function to a for loop or list comprehension in the input
directive and change the conditions in if/elif(condition)
.
There are a few ways of doing this. One way without the need for regex but under the naming standard that the sequence id and extension are separated by a single dot is using split only on first occurence. For example, if you had filename in which there are two identifiers or more separated with a .
(e.g. {sequence_id1}.{sequence_id2}.{extension}
) you would have to use regex but the logic is similar to below.
You can test this example by creating an input directory with the following files:
$ mkdir input
$ for i in 1 2 3;do touch input/sequence"$i";done
$ for i in 4 5 6;do touch input/sequence"$i".gz;done
$ for i in 7 8 9;do touch input/sequence"$i".fq.gz;done
$ for i in 10 11 12;do touch input/sequence"$i".bzip;done
The following Snakefile implementation would do what you require and would allow performing different actions depending on whether there is an extension and what type of extension it is:
###Snakefile
# Get all filenames in a specific input directory
wildcards = glob_wildcards('input/{fq_files}')
# Split the filenames into basename and extension
files = [filename.split('.', 1) for filename in wildcards.fq_files]
# Create a dictionary of mapping basename:extension
file_dict = {filename[0]: filename[1] if len(
filename) == 2 else '' for filename in files}
rule all:
input:
expand('output/{seqid}.bam', seqid=file_dict.keys()),
rule generate_bams:
input:
lambda wc: f'input/{{seqid}}.{file_dict[wc.seqid]}' if file_dict[wc.seqid] != '' else 'input/{seqid}',
output: 'output/{seqid}.bam',
run:
if (file_dict[wildcards.seqid] == 'gz'):
shell(
'echo "FILENAME = {input}nFile has gz in filename" > {output}')
elif (file_dict[wildcards.seqid] == 'fq.gz'):
shell(
'echo "FILENAME = {input}nFile has fq.gz in filename" > {output}')
elif (file_dict[wildcards.seqid] == 'bzip'):
shell(
'echo "FILENAME = {input}nFile has bzip in filename" > {output}')
else:
shell(
'echo "FILENAME = {input}nFile has no extension in filename" > {output}')
Since glob_wildcards
will not keep the extension to basename mapping, you can split the filename and create a basename:extension mapping. After creating this dictionary, you can always access it during input and params specification or run/shell directives. You can do similar with regex by changing the split part into a regex and obtaining the matching groups.
I am using Python 3.6 and if you have Python that is below 3.6 you can change the string literal portion:
lambda wc: f'input/{{seqid}}.{file_dict[wc.seqid]}' if file_dict[wc.seqid] != '' else 'input/{seqid}',
to:
lambda wc: 'input/{{seqid}}.{0}'.format(file_dict[wc.seqid]) if file_dict[wc.seqid] != '' else 'input/{seqid}',
So if there are filenames w/o extensions or with various extensions you can account for them using glob_wilcards
, split
and a dictionary for storing the basename:extension mapping.
In the future you should try to provide example input, output and if not a working example at least what you tried.
EDIT
I assumed that you do not have same sequence names with different extensions. If you do want to account for that as well, you can map a sequence name to multiple extensions. You can do this by changing:
### Create a dictionary of mapping basename:extension
# file_dict = {filename[0]: filename[1] if len(
# filename) == 2 else '' for filename in files}
### Creata dictionary of mapping basename: [extensions]
file_dict = {}
for filename in files:
if len(filename) == 2:
file_dict.setdefault(filename[0],).append(filename[1])
else:
file_dict.setdefault(filename[0],).append('')
print(file_dict)
Doing this you would also need to change the lambda function to a for loop or list comprehension in the input
directive and change the conditions in if/elif(condition)
.
edited Nov 20 '18 at 10:48
answered Nov 19 '18 at 22:49
JohnnyBDJohnnyBD
11115
11115
add a comment |
add a comment |
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%2f53379629%2fsnakefile-and-wildcard-regex-for-output-file-naming%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
Show your Minimal, Complete, and Verifiable example so potential answers have some context. Maybe edit the question and make it fit the expected format: what are you trying to do, what did you try, and what results did you get.
– jdv
Nov 19 '18 at 17:30