Sponsored Content
Top Forums Shell Programming and Scripting randomly shuffle two text files the same way Post 302551842 by adrunknarwhal on Wednesday 31st of August 2011 08:39:15 PM
Old 08-31-2011
Thank you for the help. I was looking at the paste command while I was waiting for a response. I was close to figuring it out but I was having trouble separating the lines after I shuffled them. Thanks again.
 

8 More Discussions You Might Find Interesting

1. AIX

Randomly appearing control characters in text files

Hi, From some time, we have noticed that our ascii files have started corrupting due to the presence of some random control characters (^@, ^M, ^H, ^D). The characters appear randomly on any file after the process that creates the file finishes. If we rerun the process, the files re creates... (0 Replies)
Discussion started by: aakashahuja
0 Replies

2. UNIX for Dummies Questions & Answers

randomly renaming files

I have a directory of files that look like filename 001.ext, filename 002.ext, etc. I'd like to rename the files with unique random numbered names, so that the original filenames are stripped and the files are given a new, random number name. I'm not super new to UNIX, but I don't often use it for... (2 Replies)
Discussion started by: platz
2 Replies

3. Shell Programming and Scripting

shuffle pack of words in line

hello i just seeking for a simple way to make a shuffle by block of words in a line. no matter shell (sh/bash) or perl should be like this: the message (which is line of some file) splits to packs (packs are random 5-10 words in each) then making a new line inserting those packs in a random... (9 Replies)
Discussion started by: tip78
9 Replies

4. UNIX for Dummies Questions & Answers

How to randomly select lines from a text file

I have a text file with 1000 lines, I want to randomly select 200 lines from it and print them as output. How do I go about doing that? Thanks! (7 Replies)
Discussion started by: evelibertine
7 Replies

5. Shell Programming and Scripting

Randomly selecting sequences and generating specific output files

I have two files containing hundreds of different sequences with the same Identifiers (ID-001, ID-002, etc.,), something like this: Infile1: ID-001 ATGGGAGCGGGGGCGTCTGCCTTGAGGGGAGAGAAGCTAGATACA ID-002 ATGGGAGCGGGGGCGTCTGTTTTGAGGGGAGAGAAGCTAGATACA ID-003... (18 Replies)
Discussion started by: Xterra
18 Replies

6. Shell Programming and Scripting

How to shuffle odd and even columns?

Is there any way to place each even column name infront of its odd column using awk or others? input Ab name MGH26 B04 MGH26 B05 output name_Ab B04_MGH26 B05_MGH26 (4 Replies)
Discussion started by: quincyjones
4 Replies

7. Shell Programming and Scripting

Randomized shuffle words on each line

Hi Folks, I have a text file with a thousand lines consisting of words or a group of words separated by commas. I would like to randomize / shuffle the words on each line. Eg; file.txt Linux,Open,Free,Awesome,Best Things in Life,The Greatest Laptop,PC,Tablet,Home Computers,Digital... (2 Replies)
Discussion started by: martinsmith
2 Replies

8. UNIX for Beginners Questions & Answers

Logic shuffle

Hi, Is there any way I can shuffle the numbers randomly. I have been trying to google and I found lots of 'generator' but is it possible to find the background logic to create randomness? Thanks, (3 Replies)
Discussion started by: Indra2011
3 Replies
shuffle(1)							  Biosquid Manual							shuffle(1)

NAME
shuffle - randomize the sequences in a sequence file SYNOPSIS
shuffle [options] seqfile DESCRIPTION
shuffle reads a sequence file seqfile, randomizes each sequence, and prints the randomized sequences in FASTA format on standard output. The sequence names are unchanged; this allows you to track down the source of each randomized sequence if necessary. The default is to simply shuffle each input sequence, preserving monosymbol composition exactly. To shuffle each sequence while preserving both its monosymbol and disymbol composition exactly, use the -d option. The -0 and -1 options allow you to generate sequences with the same Markov properties as each input sequence. With -0, for each input sequence, 0th order Markov statistics are collected (e.g. symbol composition), and a new sequence is generated with the same composition. With -1, the generated sequence has the same 1st order Markov properties as the input sequence (e.g. the same disymbol frequencies). Note that the default and -0, or -d and -1, are similar; the shuffling algorithms preserve composition exactly, while the Markov algorithms only expect to generate a sequence of similar composition on average. Other shuffling algorithms are also available, as documented below in the options. OPTIONS
-0 Calculate 0th order Markov frequencies of each input sequence (e.g. residue composition); generate output sequence using the same 0th order Markov frequencies. -1 Calculate 1st order Markov frequencies for each input sequence (e.g. diresidue composition); generate output sequence using the same 1st order Markov frequencies. The first residue of the output sequence is always the same as the first residue of the input sequence. -d Shuffle the input sequence while preserving both monosymbol and disymbol composition exactly. Uses an algorithm published by S.F. Altschul and B.W. Erickson, Mol. Biol. Evol. 2:526-538, 1985. -h Print brief help; includes version number and summary of all options, including expert options. -l Look only at the length of each input sequence; generate an i.i.d. output protein sequence of that length, using monoresidue fre- quencies typical of proteins (taken from Swissprot 35). -n <n> Make <n> different randomizations of each input sequence in seqfile, rather than the default of one. -r Generate the output sequence by reversing the input sequence. (Therefore only one "randomization" per input sequence is possible, so it's not worth using -n if you use reversal.) -t <n> Truncate each input sequence to a fixed length of exactly <n> residues. If the input sequence is shorter than <n> it is discarded (therefore the output file may contain fewer sequences than the input file). If the input sequence is longer than <n> a contiguous subsequence is randomly chosen. -w <n> Regionally shuffle each input sequence in window sizes of <n>, preserving local residue composition in each window. Probably a bet- ter shuffling algorithm for biosequences with nonstationary residue composition (e.g. composition that is varying along the sequence, such as between different isochores in human genome sequence). -B (Babelfish). Autodetect and read a sequence file format other than the default (FASTA). Almost any common sequence file format is recognized (including Genbank, EMBL, SWISS-PROT, PIR, and GCG unaligned sequence formats, and Stockholm, GCG MSF, and Clustal align- ment formats). See the printed documentation for a complete list of supported formats. EXPERT OPTIONS
--informat <s> Specify that the sequence file is in format <s>, rather than the default FASTA format. Common examples include Genbank, EMBL, GCG, PIR, Stockholm, Clustal, MSF, or PHYLIP; see the printed documentation for a complete list of accepted format names. This option overrides the default expected format (FASTA) and the -B Babelfish autodetection option. --nodesc Do not output any sequence description in the output file, only the sequence names. --seed <s> Set the random number seed to <s>. If you want reproducible results, use the same seed each time. By default, shuffle uses a dif- ferent seed each time, so does not generate the same output in subsequent runs with the same input. SEE ALSO
afetch(1), alistat(1), compalign(1), compstruct(1), revcomp(1), seqsplit(1), seqstat(1), sfetch(1), sindex(1), sreformat(1), stranslate(1), weight(1). AUTHOR
Biosquid and its documentation are Copyright (C) 1992-2003 HHMI/Washington University School of Medicine Freely distributed under the GNU General Public License (GPL) See COPYING in the source code distribution for more details, or contact me. Sean Eddy HHMI/Department of Genetics Washington University School of Medicine 4444 Forest Park Blvd., Box 8510 St Louis, MO 63108 USA Phone: 1-314-362-7666 FAX : 1-314-362-2157 Email: eddy@genetics.wustl.edu Biosquid 1.9g January 2003 shuffle(1)
All times are GMT -4. The time now is 04:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy