Sponsored Content
Top Forums Shell Programming and Scripting Awk: check element in array and it's value Post 303007703 by genome on Monday 20th of November 2017 02:01:53 PM
Old 11-20-2017
It's not important which of the three lines are to be selected from chromosome 2. I'd like to see if same position is present across different chrosomes.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

acessing awk array element while getline < "file"

I am attempting to write a awk script that reads in a file after awk array elements are assigned and using those elements while reading in the new file. Does this make sense? /pattern/ {tst=$3} (( getline < "file" ) > 0 ) { x=x " "tst } When I print tst in the END statement it... (9 Replies)
Discussion started by: timj123
9 Replies

2. Shell Programming and Scripting

How to check index of a array element in shell script?

Example - Script to find the index of a month from array MONTHS="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" set -A MON $MONTHS A="Sun May 23 09:34:30 GMT 2010" getMonth=`echo $A|cut -c5-7` ##getMonth=May Arrayindex_in_MONTHS_array= ???? # { 0,1,2,3,4 } - at fifth place ... (7 Replies)
Discussion started by: KuldeepSinghTCS
7 Replies

3. Shell Programming and Scripting

Help! Yet another check element in array Question

Greetings, DISCLAIMER: My shell scripting is rusty so my question may be borderline stupid. You've been warned. I need to create a script that a) lists the content of zip files in a directory and b) sends out an `exception` report. My ZIP files contain a control file (for load check). I want... (2 Replies)
Discussion started by: alan
2 Replies

4. Shell Programming and Scripting

remove an element from array

I need to remove an element from the below array variable TABLENAME. #!/bin/ksh set -A TABLENAME "mirf roxar keke mirs" echo "the array is ${TABLENAME}" If i need to remove say keke and have the final TABLENAME as below, how this could be achieved. Pls throw some light. echo "Modified... (3 Replies)
Discussion started by: michaelrozar17
3 Replies

5. Shell Programming and Scripting

Multiplying array element

I am trying to take all the elements of an array and multiply them by 2, and then copy them to a new array. Here is what I have i=0 for true in DMGLIST do let DMGSIZES2="${DMGSIZES}"*2 let i++ done unset i echo ${DMGSIZES2} It does the calculation correctly for the first element,... (7 Replies)
Discussion started by: nextyoyoma
7 Replies

6. Shell Programming and Scripting

HELP with AWK one-liner. Need to employ an If condition inside AWK to check for array variable ?

Hello experts, I'm stuck with this script for three days now. Here's what i need. I need to split a large delimited (,) file into 2 files based on the value present in the last field. Samp: Something.csv bca,adc,asdf,123,12C bca,adc,asdf,123,13C def,adc,asdf,123,12A I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies

7. Shell Programming and Scripting

Perl: How to check whether my array contains element x

Hi All, I am new to perl I am stuck in simple problem I need your help I want to define a subroutine. sub check_if_entity_exists(@array_to_be_checked,$entityName) I have array as http-listener-1 http-listener-2 http-listener-3 http-listener-4 If i send http-listener-3 my... (1 Reply)
Discussion started by: javaholics
1 Replies

8. Shell Programming and Scripting

awk Search Array Element Return Index

Can you search AWK array elements and return each index value for that element. For example an array named car would have index make and element engine. I want to return all makes with engine size 1.6. Array woulld look like this: BMW 1.6 BMW 2.0 BMW 2.5 AUDI 1.8 AUDI 1.6 ... (11 Replies)
Discussion started by: u20sr
11 Replies

9. UNIX for Advanced & Expert Users

Array Element

This question is for someone that's more familiar with Array Element. I need to know if the maximum array element that can be assigned is 1024 and if its so, Is there a workaround solution when the counter exceeded 1024? param_array="$param_nam" counter=$counter+1 #to avoid space... (3 Replies)
Discussion started by: cumeh1624
3 Replies

10. UNIX for Beginners Questions & Answers

Awk: count unique element of array

Hi, tab-separated input: blabla_1 A,B,C,C blabla_2 A,E,G blabla_3 R,Q,A,B,C,R,Q output: blabla_1 3 blabla_2 3 blabla_3 5 After splitting $2 in an array, I am trying to store the number of unique elements in a variable, but have some difficulties resetting the variable to 0 before... (6 Replies)
Discussion started by: beca123456
6 Replies
Bio::Graphics::Glyph::ideogram(3pm)			User Contributed Perl Documentation		       Bio::Graphics::Glyph::ideogram(3pm)

NAME
Bio::Graphics::Glyph::ideogram - The "ideogram" glyph SYNOPSIS
See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>. DESCRIPTION
This glyph draws a section of a chromosome ideogram. It relies on certain data from the feature to determine which color should be used (stain) and whether the segment is a telomere or centromere or a regular cytoband. The centromeres and 'var'-marked bands are rendered with diagonal black-on-white patterns if the "-patterns" option is true, otherwise they are rendered in dark gray. This is to prevent a libgd2 crash on certain 64-bit platforms when rendering patterned images. The cytobandband features would typically be formatted like this in GFF3: ... ChrX UCSC cytoband 136700001 139000000 . . . Parent=ChrX;Name=Xq27.1;Alias=ChrXq27.1;stain=gpos75; ChrX UCSC cytoband 139000001 140700000 . . . Parent=ChrX;Name=Xq27.2;Alias=ChrXq27.2;stain=gneg; ChrX UCSC cytoband 140700001 145800000 . . . Parent=ChrX;Name=Xq27.3;Alias=ChrXq27.3;stain=gpos100; ChrX UCSC cytoband 145800001 153692391 . . . Parent=ChrX;Name=Xq28;Alias=ChrXq28;stain=gneg; ChrY UCSC cytoband 1 1300000 . . . Parent=ChrY;Name=Yp11.32;Alias=ChrYp11.32;stain=gneg; which in this case is a GFF-ized cytoband coordinate file from UCSC: http://hgdownload.cse.ucsc.edu/goldenPath/hg16/database/cytoBand.txt.gz and the corresponding GBrowse config options would be like this to create an ideogram overview track for the whole chromosome: The 'chromosome' feature below would aggregated from bands and centromere using the default chromosome aggregator [CYT:overview] feature = chromosome glyph = ideogram fgcolor = black bgcolor = gneg:white gpos25:silver gpos50:gray gpos:gray gpos75:darkgray gpos100:black acen:cen gvar:var arcradius = 6 height = 25 bump = 0 label = 0 A script to reformat UCSC annotations to GFF3 format can be found at the end of this documentation. 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 -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) The following options are specific to the ideogram glyph. Option Description Default ------ ----------- ------- -bgcolor Band coloring string none -bgfallback Coloring to use when no bands yellow are present -bgcolor is used to map each chromosome band's "stain" attribute into a color or pattern. It is a string that looks like this: gneg:white gpos25:silver gpos50:gray gpos:gray gpos75:darkgray gpos100:black acen:cen gvar:var This is saying to use "white" for features whose stain attribute is "gneg", "silver" for those whose stain attribute is "gpos25", and so on. Several special values are recognized: "stalk" draws a narrower gray region and is usually used to indicate an acrocentric stalk. "var" creates a diagonal black-on-white pattern. "cen" draws a centromere. If -bgcolor is just a color name, like "yellow", the glyph will ignore all bands and just draw a filled in chromosome. If -bgfallback is set to a color name or value, then the glyph will fall back to the indicated background color if the chromosome contains no bands. UCSC TO GFF CONVERSION SCRIPT
The following short script can be used to convert a UCSC cytoband annotation file into GFF format. If you have the lynx web-browser installed you can call it like this in order to download and convert the data in a single operation: fetchideogram.pl http://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/cytoBand.txt.gz Otherwise you will need to download the file first. Note the difference between this script and input data from previous versions of ideogram.pm: UCSC annotations are used in place of NCBI annotations. #!/usr/bin/perl use strict; my %stains; my %centros; my %chrom_ends; foreach (@ARGV) { if (/^(ftp|http|https):/) { $_ = "lynx --dump $_ |gunzip -c|"; } elsif (/.gz$/) { $_ = "gunzip -c $_ |"; } print STDERR "Processing $_ "; } print "##gff-version 3 "; while(<>) { chomp; my($chr,$start,$stop,$band,$stain) = split / /; $start++; $chr = ucfirst($chr); if(!(exists($chrom_ends{$chr})) || $chrom_ends{$chr} < $stop) { $chrom_ends{$chr} = $stop; } my ($arm) = $band =~ /(p|q)d+/; $stains{$stain} = 1; if ($stain eq 'acen') { $centros{$chr}->{$arm}->{start} = $stop; $centros{$chr}->{$arm}->{stop} = $start; next; } $chr =~ s/chr//i; print qq/$chr UCSC cytoband $start $stop . . . Parent=$chr;Name=$chr;Alias=$chr$band;stain=$stain; /; } foreach my $chr(sort keys %chrom_ends) { my $chr_orig = $chr; $chr =~ s/chr//i; print qq/$chr UCSC centromere $centros{$chr_orig}->{p}->{stop} $centros{$chr_orig}->{q}->{start} . + . Parent=$chr;Name=$chr\_cent /; } 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
Gudmundur A. Thorisson <mummi@cshl.edu> Copyright (c) 2001-2006 Cold Spring Harbor Laboratory CONTRIBUTORS
Sheldon McKay <mckays@cshl.edu<gt> 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::ideogram(3pm)
All times are GMT -4. The time now is 06:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy