Sponsored Content
Top Forums Shell Programming and Scripting Getting the non-homogenous letter row from a text file Post 302832825 by Don Cragun on Monday 15th of July 2013 09:12:45 PM
Old 07-15-2013
Quote:
Originally Posted by Lucky Ali
How do I modify the above code so that it would count the occurrence of the alphabet that is different from the first alphbet in each of the lines and output the position number/ numbers of that different alphabet only.

Desired output

Code:
CCCCCGCCCCCCCCCCcCCCCCCCCCCCCCCC G 6
AAAATAAAAAAAAAAAaAAAAAAAAAAAAAA    T 5
TGTTTTTTTTTTTTGGtTTTTTTTTTTTTTTT G 2 15 16
TTTT-TTTTTTTTTCTtTTTTTTTTTTTTTTT C 15

---------- Post updated at 08:20 PM ---------- Previous update was at 04:51 PM ----------

can we do this using awk?
How many times do we need to answer the same question for you?

What was wrong with the answer you got to this question a year and a half ago: alphabet counting?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing the column for a row in a text file and adding another row

Hi, I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value . For Eg . if the input file has a row : abc xyz lmn 89 lm nk o p I would like the script to create something like... (9 Replies)
Discussion started by: aYankeeFan
9 Replies

2. Shell Programming and Scripting

how can I bcp out a table into a text file including the header row in the text file

Hi All, I need to BCP out a table into a text file along with the table headers. Normal BCP out command only bulk copies the data, and not the headers. I am using the following command: bcp database1..table1 out file1.dat -c -t\| -b1000 -A8192 -Uuser -Ppassword -efile.dat.err Regards,... (0 Replies)
Discussion started by: shilpa_acc
0 Replies

3. UNIX for Dummies Questions & Answers

find positions of a letter in a text file

Hi, I would like to know how can I get all the positions of a letter, let say letter C in a text file. sample input file: hcck pgog hlhhc desired output file: 2 3 13 Many thanks! (2 Replies)
Discussion started by: fadista
2 Replies

4. UNIX for Dummies Questions & Answers

How do you delete cells from a space delimited text file given row and column number?

How do you delete cells from a space delimited text file given row and column number? Letś say the row number is r and the column number is c. Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies

5. UNIX for Dummies Questions & Answers

Adding a column to a text file with row numbers

Hi, I would like to add a new column containing the row numbers to a text file. How do I go about doing that? Thanks! Example input: A X B Y C D Output: A X 1 B Y 2 C D 3 (5 Replies)
Discussion started by: evelibertine
5 Replies

6. Shell Programming and Scripting

Select row from file and text

Hi all! I would like to solve a problem but I have no clue of how do it!I will be grateful if someone could help me! Briefly I have a big file like this: >ENSMUSG00000000204 | ENSMUST00000159637 GGCGAGGCTTACGCCATTTTACCTCAGCGAGCATTCATAAAGCTGCGAGCATTCATACAG >ENSMUSG00000000204 |... (3 Replies)
Discussion started by: giuliangiuseppe
3 Replies

7. Shell Programming and Scripting

Search row by row from one file to another file if match is found print few colums of file 2

this is the requirement list.txt table1 table2 table3 testfile.txt name#place#data#select * from table1 name2#place2#data2#select * from table 10 innerjoin table3 name2#place2#data2#select * from table 10 output name place table1 name2 place table3 i tried using awk (7 Replies)
Discussion started by: vamsekumar
7 Replies

8. Shell Programming and Scripting

Replace specific letter in a file by other letter

Good afternoon all, I want to ask how to change some letter in my file with other letter in spesific line eg. data.txt 1 1 1 0 0 0 0 for example i want to change the 4th line with character 1. How could I do it by SED or AWK. I have tried to run this code but actually did not... (3 Replies)
Discussion started by: weslyarfan
3 Replies

9. Shell Programming and Scripting

Column to row and position data in a text file

Hi everyone.. I have a list of values in a file... a, b, c, 1, 2, 3, aaaa, bbbbb, I am interested in converting this column to a row.. "text",aaaa, bbbb a,1 (7 Replies)
Discussion started by: manihi
7 Replies

10. Shell Programming and Scripting

Print every alternate column in row in a text file

Hi, I have a comma separated file. I would like to print every alternate columns into a new row. Example input file: Name : John, Age : 30, DOB : 30-Oct-2018 Example output: Name,Age,DOB John,30,30-Oct-2018 (3 Replies)
Discussion started by: Lini
3 Replies
Bio::Symbol::AlphabetI(3pm)				User Contributed Perl Documentation			       Bio::Symbol::AlphabetI(3pm)

NAME
Bio::Symbol::AlphabetI - A Symbol Alphabet SYNOPSIS
# get a Bio::Symbol::AlphabetI object somehow my @symbols = $alphabet->symbols; my @subalphas = $alphabet->alphabets; if( $alphabet->contains($symbol) ) { # do something } DESCRIPTION
Alphabet contains set of symbols, which can be concatenated to form symbol lists. Sequence string, for example, is stringified representation of the symbol list (tokens of symbols). This module was implemented for the purposes of meeting the BSANE/BioCORBA spec 0.3 only. 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 the Bioperl mailing list. 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 of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Jason Stajich Email jason@bioperl.org APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ AlphabetI Interface methods symbols Title : symbols Usage : my @symbols = $alphabet->symbols(); Function: Get/Set Symbol list for an alphabet List of symbols, which make up this alphabet. Returns : Array of L<Bio::Symbol::SymbolI> objects Args : (optional) Array of L<Bio::Symbol::SymbolI> objects alphabets Title : alphabets Usage : my @alphabets = $alphabet->alphabets(); Function: Get/Set Sub Alphabet list for an alphabet Sub-alphabets. E.g. codons made from DNAxDNAxDNA alphabets Returns : Array of L<Bio::Symbol::AlphabetI> objects Args : (optional) Array of L<Bio::Symbol::AlphabetI> objects contains Title : contains Usage : if($alphabet->contains($symbol)) { } Function: Tests of Symbol is contained in this alphabet Returns : Boolean Args : L<Bio::Symbol::SymbolI> perl v5.14.2 2012-03-02 Bio::Symbol::AlphabetI(3pm)
All times are GMT -4. The time now is 01:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy