Quickbrowse: Go to a tool by selecting the abbreviated tool name from the menu.
Contents: Click a blue triangle to expand or collapse a list
To use a script, cut and paste the code from the light green or blue box into a
terminal window, change the bold, red text as needed, and hit Enter.
See More Information for notes on using these tools.
See General Sorting Notes for details on sorting order.
Sort the lines in the file in ascending alphabetical order.
Example: Sort a gene list. Run the above script on a file called
unsorted
to get a file called sorted
:
Original file (unsorted ) |
Output file (sorted_asc ) |
Screen Output |
ap23 7
ap23 30
CG2500 3
cxb7 2
CG12345 9
CG2500 3
|
CG12345 9
CG2500 3
CG2500 3
ap23 30
ap23 7
cxb7 2
|
Sorted 6 lines in ascending alphabetical order
|
Sort the lines in the file in descending alphabetical order.
Example: Sort a gene list. Run the above script on a file called
unsorted
to get a file called sorted_desc
:
Original file (unsorted ) |
Output file (sorted_desc ) |
Screen Output |
ap23 7
ap23 30
CG2500 3
cxb7 2
CG12345 9
CG2500 3
|
cxb7 2
ap23 7
ap23 30
CG2500 3
CG2500 3
CG12345 9
|
Sorted 6 lines in descending alphabetical order
|
Z and z will count as the same letter in these sorts.
See General Sorting Notes for more details on sorting order.
Sort the lines in the file in ascending alphabetical order, counting
z and Z as the same.
Example: Sort a gene list. Run the above script on a file called
unsorted
to get a file called sorted_nc_asc
:
Original file (unsorted ) |
Output file (sorted_nc_asc ) |
Screen Output |
ap23 7
ap23 30
CG2500 3
cxb7 2
CG12345 9
CG2500 3
|
ap23 30
ap23 7
CG12345 9
CG2500 3
CG2500 3
cxb7 2
|
Sorted 6 lines in ascending alphabetical order, ignoring case
|
Sort the lines in the file in descending alphabetical order, counting
z and Z as the same.
Example: Sort a gene list. Run the above script on a file called
unsorted
to get a file called sorted_nc_desc
:
Original file (unsorted ) |
Output file (sorted_nc_desc ) |
Screen Output |
ap23 7
ap23 30
CG2500 3
cxb7 2
CG12345 9
CG2500 3
|
cxb7 2
CG2500 3
CG2500 3
CG12345 9
ap23 7
ap23 30
|
Sorted 6 lines in descending alphabetical order, ignoring case
|
See General Sorting Notes for more details on sorting order.
Sort a simple list numerically.
Example: Sort a list of numbers. Run the above script on a file called
unsorted
to get a file called sorted_num_asc
:
Original file (unsorted ) |
Output file (sorted_num_asc ) |
Screen Output |
3
12
78.5
-10
1e5
1e-3
|
-10
1e-3
3
12
78.5
1e5
|
Sorted 6 lines in ascending numerical order
|
Example: Sort a list of numbers. Run the above script on a file called
unsorted
to get a file called sorted_num_desc
:
Original file (unsorted ) |
Output file (sorted_num_desc ) |
Screen Output |
3
12
78.5
-10
1e5
1e-3
|
1e5
78.5
12
3
1e-3
-10
|
Sorted 6 lines in ascending numerical order
|
Sort lines in a tab-separated file in ascending order, based on the numerical
value in a given column.
Example: Sort a gene list based on the score in the first column. Run the
above script on a file called unsorted
to get a file called sorted_col
:
Original file (unsorted ) |
Output file (sorted_col ) |
Screen Output |
ap23 7
ap23 30
CG2500 3
cxb7 2
CG12345 9
CG2500 3
|
cxb7 2
CG2500 3
CG2500 3
ap23 7
CG12345 9
ap23 30
|
Sorted 6 lines in ascending order, based on numerical values in column 1
|
Sort lines in a tab-separated file in descending order, based on the
numerical values in a given column.
Example: Sort a gene list based on the score in the second, tab-separated
column. Run the above script on a file called unsorted
to get a file
called sorted_col
:
Original file (unsorted ) |
Output file (sorted_col ) |
Screen Output |
ap23 7
ap23 30
CG2500 3
cxb7 2
CG12345 9
CG2500 3
|
ap23 30
CG12345 9
ap23 7
CG2500 3
CG2500 3
cxb7 2
|
Sorted 6 lines in descending order, based on numerical values in column 1
|
Sort lines in a tab-separated file in ascending order, based on the text
strings in a given column.
Example: Sort a gene list based on the gene name in the second,
tab-separated column. Run the above script on a file called unsorted
to get
a file called sorted_col
:
Original file (unsorted ) |
Output file (sorted_col ) |
Screen Output |
1 ap23 7
2 ap23 30
3 CG2500 3
4 cxb7 2
5 CG12345 9
6 CG2500 3
|
5 CG12345 9
3 CG2500 3
6 CG2500 3
1 ap23 7
2 ap23 30
4 cxb7 2
|
Sorted 6 lines in ascending order, based on text strings in column 1
|
Sort lines in a tab-separated file in descending order, based on the text
strings in a given column.
Example: Sort a gene list based on the gene name in the second,
tab-separated column. Run the above script on a file called unsorted
to get
a file called sorted_col
:
Original file (unsorted ) |
Output file (sorted_col ) |
Screen Output |
1 ap23 7
2 ap23 30
3 CG2500 3
4 cxb7 2
5 CG12345 9
6 CG2500 3
|
4 cxb7 2
1 ap23 7
2 ap23 30
3 CG2500 3
6 CG2500 3
5 CG12345 9
|
Sorted 6 lines in descending order, based on text strings in column 1
|
See Choose columns in a given order (choose_cols) in the Choose manpage.
The tools as written will sort the given file1 and send the result to
the given output file. In fact, any number of input files can be used
(before the '>' sign), but just one output file.
Change the filenames as you wish.
Sorting order: Note that 100 will come before 20 when sorting
alphabetically, because 1 comes before 2.
Also, lower-case letters come after all of the upper-case
letters (i.e., a will come after Z), unless case-sensitive sorting is used.
(i.e., when sorting in ascending order, "arabidopsis" will come after
"Zebrafish"), unless case-insensitive sorting is used. See the examples below
for demonstrations of these rules.
Duplicates will not be eliminated. That is, if the same line appears five
times in a file, it will appear five times (in a row) in the output file.
Scriptome tools are in blue or green boxes. Cut and paste the text of the
tool into a terminal window. Then edit the line as needed.
Things that will often need to be edited are highlighted in
red. Input and output filenames will almost always need to be changed.
All scripts that work on tabular data assume the data is tab-separated.
Use a Change script to change, e.g., comma-separated data
to tab-separated before using these scripts.