awk to split one field and print the last two fields within the split part.
Hello;
I have a file consists of 4 columns separated by tab. The problem is the third fields. Some of the them are very long but can be split by the vertical bar "|". Also some of them do not contain the string "UniProt", but I could ignore it at this moment, and sort the file afterwards. Here is the input file like (>100k rows!!!):
Code:
B_1019927 ES904790 Unknown Unknown protein
B_1065532 JCVI_27855 JCVI_27855|gb|DW997385|gb|CD815403|gb|EV204160|gb|CD813268|gb|EX038736|UniProt|Q8RWM2 Putative uncharacterized protein At4g36940
B_1065533 JCVI_27856 JCVI_27856|gb|CD826551|gb|DY030639|gb|CX272767|gb|EV056662|gb|EX022554|gb|EX038271|UniProt|Q3E9T4 Protein At4g31430
B_1065534 JCVI_27857 JCVI_27857|gb|DY023794|gb|EE530065|gb|CX280035|UniProt|Q84WF5 Probable VAMP-like protein At1g33475
B_1065535 JCVI_27858 JCVI_27858|gb|ES941909|gb|ES940913|gb|EE514812|UniProt|Q8LBM4 Iron-sulfur assembly protein IscA-like 1, mitochondrial precursor
I want the output file with the truncated field-3, which is like following:
Code:
B_1019927 ES904790 Unknown Unknown protein
B_1065532 JCVI_27855 UniProt Q8RWM2 Putative uncharacterized protein At4g36940
B_1065533 JCVI_27856 UniProt Q3E9T4 Protein At4g31430
B_1065534 JCVI_27857 UniProt Q84WF5 Probable VAMP-like protein At1g33475
B_1065535 JCVI_27858 Uniprot Q8LBM4 Iron-sulfur assembly protein IscA-like 1, mitochondrial precursor
What I did is by matching the "UniProt" string in the third field, split this field and only print the last two columns of the split fields, the original 3 fields ($1, $2, $4) need to be printed untouched.
Hi all,
I have a field in the line, let's say argument $6, which is in the format 00.00
If i want to split the field to get rid of the "." in between of the amount, how can i do that i awk script?
I have it like this
split($6,a,".")
but it will get rid of the last 2 digits after the... (4 Replies)
I am trying to pull data out of a file to execute a series of repetitive commands. One of the fields is a {hex number}.{hex number} pattern. I need the first part of that structure to pass into the command. The file structure is like this:
A 2007/10/20 09:50:00 li text ef6da.1 name ... (6 Replies)
Hi,
I have a comma delimited text file where character fields (as opposed to numeric and date fields) are always enclosed with double quotes. Records are separated by the newline character. In a shell script I would like to split a particular field into two separate fields (enclosed with double... (4 Replies)
Hi there I have a text file with several fields separated by ";" as follow :
5466-43;5466;JOAN;LIGA;LIGA ESPANOLA;43;DEP LA CORUNA - OSASUNA;10/01/10 17:00
5466-44;5466;CARLES;LIGA;LIGA ESPANOLA;44;MALAGA - ATHL BILBAO;10/01/10 17:00
5466-45;5466;FAB;LIGA;LIGA ESPANOLA;45;REAL MADRID -... (4 Replies)
Hi all,
I have a .vcf file which contains 8 coulmns and the data under each column as shown below,
CHROM POS ID REF ALT QUAL FILTER INFO
1 3000012 . A G 126 ... (6 Replies)
I want to use awk to split fields and put them into a file
but I don't know the number of fields
for example, in the following line
Ports: 22/filtered/tcp//ssh///, 53/open/tcp//tcpwrapped///, 111/filtered/tcp//rpcbind///, 543/filtered/tcp//klogin///, 544/filtered/tcp//kshell///,... (3 Replies)
Hi experts,
I need to print the first field first then last two fields should come next and then i need to print rest of the fields.
Input :
a1,abc,jsd,fhf,fkk,b1,b2
a2,acb,dfg,ghj,b3,c4
a3,djf,wdjg,fkg,dff,ggk,d4,d5
Expected output:
a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
I am trying to split a tab-delimeted file using awk after the second _ in bold. The awk below is close but splits on the first _, and I am not sure how to use the second _. Thank you :).
file
chr1 92145889 92149424 NM_001195684_exon_0_10_chr1_92145900_r 0 -
chr1 92161218 ... (4 Replies)
In the tab-delimited input below I am trying to use awk to -10 from $2 and +10 to $3. Something like
awk -F'\t' -v OFS='\t' -v s=10 '{split($4,a,":"); print $1,$2-s,$3+s,a,$5,$6} | awk {split(a,b,"-"); print $1,$2-s,$3+s,b-s,b+s,$5,$6}' input
should do that. I also need to -10 from $4... (2 Replies)
In the awk I am splitting on the : into array a, then splitting on the - into element b. I can not seem to duplicate b if there is no - after it. Lines 1,2,4 are examples. If there is a - after the number in b then the value to the right of it is $3 in the ouput. Thank you :).
awk... (2 Replies)
Discussion started by: cmccabe
2 Replies
LEARN ABOUT DEBIAN
bio::graphics::glyph::protein
Bio::Graphics::Glyph::protein(3pm) User Contributed Perl Documentation Bio::Graphics::Glyph::protein(3pm)NAME
Bio::Graphics::Glyph::protein - The "protein" glyph
SYNOPSIS
See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
DESCRIPTION
This glyph draws protein sequences. At high magnifications, this glyph will draw the actual amino acids of the sequence. At low
magnifications, the glyph will plot the Kyte-Doolite hydropathy. By default, the KD plot will use a window size of 9 residues, but this
can be changed by specifying the kd_window option.
The feature may return either a protein sequence or a DNA sequence in response to the seq() method. However, if it returns a DNA sequence,
then the feature must also return the correct phase and strand in order for the glyph to translate its open reading frame correctly!
OPTIONS
The following options are standard among all Glyphs. See Bio::Graphics::Glyph for a full explanation.
Option Description Default
------------------------
-fgcolor Foreground color black
-outlinecolor Synonym for -fgcolor
-bgcolor Background color turquoise
-fillcolor Synonym for -bgcolor
-linewidth Line width 1
-height Height of glyph 10
-font Glyph font gdSmallFont
-connector Connector type 0 (false)
-connector_color
Connector color black
-label Whether to draw a label 0 (false)
-description Whether to draw a description 0 (false)
-hilite Highlight color undef (no color)
In addition to the common options, the following glyph-specific options are recognized:
Option Description Default
------------------------
-do_kd Whether to draw the Kyte- true
Doolittle hydropathy plot
at low mags
-kd_window Size of the sliding window 9
to use in the KD hydropathy
calculation.
-axis_color Color of the vertical axes fgcolor
in the KD hydropathy plot
-phase_style The way phase is to be
interpreted. One of "012"
"012" or "021"
BUGS
Please report them.
SEE ALSO
Bio::Graphics::Panel, Bio::Graphics::Glyph, Bio::Graphics::Glyph::arrow, Bio::Graphics::Glyph::cds, Bio::Graphics::Glyph::crossbox,
Bio::Graphics::Glyph::diamond, Bio::Graphics::Glyph::dna, Bio::Graphics::Glyph::dot, Bio::Graphics::Glyph::ellipse,
Bio::Graphics::Glyph::extending_arrow, Bio::Graphics::Glyph::generic, Bio::Graphics::Glyph::graded_segments,
Bio::Graphics::Glyph::heterogeneous_segments, Bio::Graphics::Glyph::line, Bio::Graphics::Glyph::pinsertion, Bio::Graphics::Glyph::primers,
Bio::Graphics::Glyph::rndrect, Bio::Graphics::Glyph::segments, Bio::Graphics::Glyph::ruler_arrow, Bio::Graphics::Glyph::toomany,
Bio::Graphics::Glyph::transcript, Bio::Graphics::Glyph::transcript2, Bio::Graphics::Glyph::translation, Bio::Graphics::Glyph::triangle,
Bio::DB::GFF, Bio::SeqI, Bio::SeqFeatureI, Bio::Das, GD
AUTHOR
Aaron J. Mackey, based on the "dna" glyphy by Lincoln Stein <lstein@cshl.org> and Peter Ashton <pda@sanger.ac.uk>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for
disclaimers of warranty.
perl v5.14.2 2012-02-20 Bio::Graphics::Glyph::protein(3pm)