Sponsored Content
Full Discussion: Perl programming help
Top Forums Shell Programming and Scripting Perl programming help Post 302623837 by patiencenpray on Saturday 14th of April 2012 08:57:34 PM
Old 04-14-2012
Question Perl programming help

I am trying to make a simple perl program that reads 20 characters upstream from the codon ATG in a given sequence. The following is what I have. I just dont know how to make the program read 20 characters upstream from the ATG codon.



Code:
print "\nThis program will read 20 characters upstream from the codon ATG in the given sequence.\n
Please, input your sequence: ";
my $sequence = <>;
chomp $sequence;

if ($sequence=~ m/ATG/g) {
    print "The sequence is $sequence";
} else {
    print "The given sequence doesn not contain ATG.\n"
}
exit;

Moderator's Comments:
Mod Comment How to use code tags

Last edited by Scrutinizer; 04-15-2012 at 10:30 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

PERL - DB programming

Hi friends, What are the possible ways to connect to DB2 database from Perl (on unix). I need to connect to DB2 and get records for further processing. Can you please suggest the best possible way. I heard about DBI/DBD, if you have some sample scripts please post them too. Thanks in advance. (3 Replies)
Discussion started by: satguyz
3 Replies

2. Shell Programming and Scripting

Perl Programming for Splitting

Hi, I am extracting SQL queries into a file and the file is as follows ********************************************************* select BatchKey ,restartStatus ,batchContextBuffer ,batchPgmId ,StartKey , EndKey ,Mcbatchcontrol_ver from qsecminload.Mcbatchcontrol_t where RefId = :1 ... (5 Replies)
Discussion started by: sagarbsa
5 Replies

3. Programming

Perl Programming with Mapping

use strict; print "Enter last 4 digits of phone number:"; chomp(my $number=<>); die "Invalid number: '$number'\n" unless $number=~/^\d{4}$/; my @d=split(undef,$number); my %map={ 2=>"", 3=>"", 4=>"", 5=>"", 6=>"", 7=>"", 8=>"", 9=>"", }; my $r=$map{$d}.$map{$d}.$map{$d}.$map{$d};... (1 Reply)
Discussion started by: tturn33
1 Replies

4. UNIX for Dummies Questions & Answers

Is PERL a programming language?

I need a small and simple clarification... Can someone tell me whether PERL is a programming language or not. Also, can shell scripts also considered as programming language or not. Also, please tell me the exact difference between programming language and scripting. Please help.... (3 Replies)
Discussion started by: Anjan1
3 Replies

5. Shell Programming and Scripting

Perl Vs Shell Programming

Can someone please tell me what the big deal about perl is? i have been doing shell programming for quite a number of years and I have to say, there's very little if any thing that I can't do in shell programming. i just need to investigate how to do it. so, my question is, does deep... (1 Reply)
Discussion started by: SkySmart
1 Replies

6. Shell Programming and Scripting

Perl programming error

Hi, everyone!! i am new to perl programming.. plz help me. #!C:/perl/bin use warnings; use strict; use Text::CSV_XS; my @rows = ""; my $row; my $count; my $fh; my @fields = ""; my $csv = Text::CSV_XS->new ({binary =>1}) or die "cannot use CSV:" .Text::CSV->error_diag (); open... (3 Replies)
Discussion started by: kvth
3 Replies

7. Programming

Programming help - Perl !

I am having a text file with Vivek 50 Ram 34 Hulk 45 Vivek 23 Ram 23 Vivek 55 Now I need a perl script to display the fields of 1st column & the 2nd column with summation (& avoid the duplicates). Vivek 128 Ram 57 hulk 45 Plz help me... (1 Reply)
Discussion started by: gameboy87
1 Replies

8. Programming

Help me with perl programming

Hi, i am very beginer to perl, I am reading one xml file and i am creating hash table for that file. i written code like this #!/usr/bin/perl use warnings; use strict; use XML::LibXML::Reader; #Reading XML with a pull parser my $file; open( $file, 'formal.xml'); my $reader =... (8 Replies)
Discussion started by: veerubiji
8 Replies

9. Shell Programming and Scripting

perl programming

how to link the linux files in perl on the local webpage ???? suppose we have some results and want to get them published on the local webpage of our internal site. how this can be done using HTML and perl together , so that the results are published directly on the webpage. thanks kullu (0 Replies)
Discussion started by: kullu
0 Replies

10. Shell Programming and Scripting

Perl programming issue

Dears, I want to print filename and count of each file in perl but failing to implement. `find $srcFolder -maxdepth 1 -type f -name "*$workDate*$fileExt" -exec sh -c ' && printf "$workDate|%s|%s\n" "$(wc -l<"$0")" *$workDate*$fileExt' {} \ >> /Sadique/filelog.out \\; 2> /dev/null`; ... (2 Replies)
Discussion started by: sadique.manzar
2 Replies
LONG-ORFS(1)						      General Commands Manual						      LONG-ORFS(1)

NAME
long-orfs -- Find/Score potential genes in genome-file using the probability model in icm-file SYNOPSIS
tigr-long-orgs [genome-file options] DESCRIPTION
Program long-orfs takes a sequence file (in FASTA format) and outputs a list of all long "potential genes" in it that do not overlap by too much. By "potential gene" I mean the portion of an orf from the first start codon to the stop codon at the end. The first few lines of output specify the settings of various parameters in the program: Minimum gene length is the length of the smallest fragment considered to be a gene. The length is measured from the first base of the start codon to the last base *before* the stop codon. This value can be specified when running the program with the -g option. By default, the program now (April 2003) will compute an optimal length for this parameter, where "optimal" is the value that produces the greatest number of long ORFs, thereby increasing the amount of data used for training. Minimum overlap length is a lower bound on the number of bases overlap between 2 genes that is considered a problem. Overlaps shorter than this are ignored. Minimum overlap percent is another lower bound on the number of bases overlap that is considered a problem. Overlaps shorter than this percentage of *both* genes are ignored. The next portion of the output is a list of potential genes: Column 1 is an ID number for reference purposes. It is assigned sequentially starting with 1 to all long potential genes. If overlap- ping genes are eliminated, gaps in the numbers will occur. The ID prefix is specified in the constant ID_PREFIX . Column 2 is the position of the first base of the first start codon in the orf. Currently I use atg, and gtg as start codons. This is easily changed in the function Is_Start () . Column 3 is the position of the last base *before* the stop codon. Stop codons are taa, tag, and tga. Note that for orfs in the reverse reading frames have their start position higher than the end position. The order in which orfs are listed is in increasing order by Max {OrfStart, End}, i.e., the highest numbered position in the orf, except for orfs that "wrap around" the end of the sequence. When two genes with ID numbers overlap by at least a sufficient amount (as determined by Min_Olap and Min_Olap_Percent ), they are elimi- nated and do not appear in the output. The final output of the program (sent to the standard error file so it does not show up when output is redirected to a file) is the length of the longest orf found. Specifying Different Start and Stop Codons: To specify different sets of start and stop codons, modify the file gene.h . Specifically, the functions: Is_Forward_Start Is_Reverse_Start Is_Start Is_Forward_Stop Is_Reverse_Stop Is_Stop are used to determine what is used for start and stop codons. Is_Start and Is_Stop do simple string comparisons to specify which patterns are used. To add a new pattern, just add the comparison for it. To remove a pattern, comment out or delete the comparison for it. The other four functions use a bit comparison to determine start and stop patterns. They represent a codon as a 12-bit pattern, with 4 bits for each base, one bit for each possible value of the bases, T, G, C or A. Thus the bit pattern 0010 0101 1100 represents the base pattern [C] [A or G] [G or T]. By doing bit operations (& | ~) and comparisons, more complicated patterns involving ambiguous reads can be tested efficiently. Simple patterns can be tested as in the current code. For example, to insert an additional start codon of CAT requires 3 changes: 1. The line || (Codon & 0x218) == Codon should be inserted into Is_Forward_Start , since 0x218 = 0010 0001 1000 represents CAT. 2. The line || (Codon & 0x184) == Codon should be inserted into Is_Reverse_Start , since 0x184 = 0001 1000 0100 represents ATG, which is the reverse-complement of CAT. Alternately, the #define constant ATG_MASK could be used. 3. The line || strncmp (S, "cat", 3) == 0 should be inserted into Is_Start . OPTIONS
-g n Set minimum gene length to n. Default is to compute an optimal value automatically. Don't change this unless you know what you're doing. -l Regard the genome as linear (not circular), i.e., do not allow genes to "wrap around" the end of the genome. This option works on both glimmer and long-orfs . The default behavior is to regard the genome as circular. -o n Set maximum overlap length to n. Overlaps shorter than this are permitted. (Default is 0 bp.) -p n Set maximum overlap percentage to n%. Overlaps shorter than this percentage of *both* strings are ignored. (Default is 10%.) SEE ALSO
tigr-glimmer3 (1), tigr-adjust (1), tigr-anomaly (1), tigr-build-icm (1), tigr-check (1), tigr-codon-usage (1), tigr-compare-lists (1), tigr-extract (1), tigr-generate (1), tigr-get-len (1), tigr-get-putative (1), http://www.tigr.org/software/glimmer/ Please see the readme in /usr/share/doc/tigr-glimmer for a description on how to use Glimmer3. AUTHOR
This manual page was quickly copied from the glimmer web site by Steffen Moeller moeller@debian.org for the Debian system. LONG-ORFS(1)
All times are GMT -4. The time now is 09:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy