Create a single bash script that does the following:
a. Print out the number of occurrences for each motif that is found in the bacterial genome and output to a file called motif_count.txt
b. Create a fasta file for each motif (so 3 in total) which contains all of the genes and their corresponding sequences that have that motif. Each file should be named after the motif (ie ATG.txt) and outputted to a new directory called motifs
motif file is a txt file with these motifs : ATG, GGGGG, ATTTT
the bacterial genome file is fasta file with the following lines
Moderator's Comments:
edit by bakunin: please use CODE-tags to let data, code and terminal output stand out. Thank you.
I have a very basic bash shell script, which has many "while... done; for .... done" loop clauses, like the following
~~
#!/bin/bash
while blablalba; do
....
done < /tmp/file
for line in `cat blablabla`; do grep $line /tmp/raw ; done > /tmp/1;
while blablalba2; do
....
done <... (2 Replies)
SEND_MESSAGE=test
echo $SEND_MESSAGE
if
then
echo `date` > update_dt_ccaps.lst
echo "The file transfer failed" >> update_dt_ccaps.lst
SEND_MESSAGE=false
fi
The above code is showing error in bash shell as :
./test: line 5: [: test: integer expression expected
... (2 Replies)
I'm trying to search all .odt files in a directory for a string in the text of the file.
I've found a bash script that works, except that it can't handle whitespace in the filenames.
#!/bin/bash
if ; then
echo "Usage: searchodt searchterm"
exit 1
fi
for file in $(ls *.odt); do
... (4 Replies)
Hi,
I am working on bash script after a long time. I am getting error near done statement while running a for loop snippet. The error says "Syntax error near unexpcted token 'done'"
please suggest what could be wrong. here is the snippet
elements=${#option_arr} //an array of values... (1 Reply)
Having issues with an expect script. I've been scripting bash, python, etc... for a couple years now, but just started to try and use Expect. Trying to create a script that takes in some arguments, and then for now, just runs a pwd command(for testing, final will be command I pass).
Here is... (0 Replies)
Hi Folks,
I have a loop that goes through an array and the output is funky.
sample:
array=( 19.239.211.30 )
for i in "${array}"
do
echo $i
iperf -c $i -P 10 -x CSV -f b -t 50 | awk 'END{print '$i',$6}' >> $file
done
Output:
19.239.211.30
19.2390.2110.3 8746886
seems that when... (2 Replies)
I have the following while loop that I put in a script, demo.sh:
while read rna; do
aawork=$(echo "${rna}" | sed -n -e 's/\(...\)\1 /gp' | sed -f rna.sed)
echo "$aawork" | sed 's/ //g'
echo "$aawork" | tr ' ' '\012' | sort | sed '/^$/d' | uniq -c | sed 's/*\(*\) \(.*\)/\2: \... (3 Replies)
Hi Everybody,
I'm a newbie to shell scripting, and I'd appreciate some help. I have a bunch of .txt files that have some unwanted content. I want to remove lines 1-3 and 1028-1098.
#!/bin/bash
for '*.txt' in <path to folder>
do
sed '1,3 d' "$f";
sed '1028,1098 d' "$f";
done
I... (2 Replies)
Dear all,
Please help with the following.
I have a file, let's call it data.txt, that has 3 columns and approx 700,000 lines, and looks like this:
rs1234 A C
rs1236 T G
rs2345 G T
Please use code tags as required by forum rules!
I have a second file, called reference.txt,... (1 Reply)
Hi everyone
I need some help
I want to create an script which does some processing
it takes the two arguments 201901010000 and 201901020200 - so YYYMMDDHHMM
I want to split processing into hours from start until end,
I dont get why this works but when I add to a future variable... (1 Reply)
Discussion started by: kl1ngac1k
1 Replies
LEARN ABOUT DEBIAN
bio::matrix::psm::psmheader
Bio::Matrix::PSM::PsmHeader(3pm) User Contributed Perl Documentation Bio::Matrix::PSM::PsmHeader(3pm)NAME
Bio::Matrix::PSM::PsmHeader - PSM mast parser implementation
SYNOPSIS
# See Bio::Matrix::PSM::IO for detailed documentation on how to use
# PSM parsers
DESCRIPTION
Parser for mast. This driver unlike meme or transfac for example is dedicated more to PSM sequence matches
FEEDBACK
Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one
of the Bioperl mailing lists. Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address
it. Please include a thorough description of the problem with code and data examples if at all possible.
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the
web:
https://redmine.open-bio.org/projects/bioperl/
AUTHOR - Stefan Kirov
Email skirov@utk.edu
APPENDIX
new
Title : new
Usage : my $header= Bio::Matrix::PSM::PsmHeader->new(-seq=>\%seq,
-mid=>\%mid,
-width=>\%width,
-instances=>\%instances,
-header=>@header,
-type=>'mast');
Function: Creates a new Bio::Matrix::PSM::PsmHeader object
Throws :
Example :
Returns : Bio::Matrix::PSM::PsmHeader object
Args : hash
seq
Title : seq
Usage : my %seq= $header->seq();
Function: Returns the sequence data as a hash, indexed by a sequence ID (motif id or accession number)
In case the input data is a motif it would return the consenus seq for each of them (mast).
Throws :
Example :
Returns : hash
Args :
hid
Title : hid
Usage : my @hid= $header->hid();
Function: Returns array with the motif ids
Throws :
Example :
Returns : array
Args :
length
Title : length
Usage : my %length= $header->length();
Function: Returns the length of the input sequence or motifs as a hash, indexed
by a sequence ID (motif id or accession number)
Throws :
Example :
Returns : hash
Args :
instances
Title : instances
Usage : my %instances= $header->instances();
Function: Returns the info about the input data, contained in the header
Throws :
Example :
Returns : hash
Args :
weight
Title : weight
Usage : my %weights= $header->weight();
Function: Returns the weights of the input sequence as a hash, indexed
by a sequence ID
Throws :
Example :
Returns : hash
Args :
unstuctured
Title : unstuctured
Usage : my @unstructured= $header->unstuctured();
Function: Returns the unstructured data in the header as an array, one line per
array element, all control symbols are removed with W
Throws :
Example :
Returns : array
Args :
version
Title : version
Usage : my $version= $header->version;
Function: Returns the version of the file being parsed if such exists
Throws :
Example :
Returns : string
Args :
release
Title : release
Usage : my $release= $header->release;
Function: Returns the release of the file being parsed if such exists
Throws :
Example :
Returns : string
Args :
_check
Title : _check
Usage : if ($self->_check('weights') { #do something} else {return 0;}
Function: Checks if the method called is aplicable to the file format
Throws :
Example :
Returns : boolean
Args : string
perl v5.14.2 2012-03-02 Bio::Matrix::PSM::PsmHeader(3pm)