STRUCTURE in Linux

2,649 views
Skip to first unread message

Shalanee

unread,
May 9, 2012, 2:21:54 AM5/9/12
to structure...@googlegroups.com
Hello all,
 
I have 201 individuals for 1168 SNPs. My input file consists of ID, pop information ,pop flag and genotypic information in one row. I got reasonable results with front end Linux. When i  changed my mechine I had to run the structure in Linux with command line. I got the message , it has an error in my input file which is very similar to the problem with Jos in discussion group. I tried to corrected it according to jos settlement but it doesnt work for me. Can any one help  me for this problem. I have copied part of an error massage and the mainparams.
 
Thanks
 
Shalanee
 

WARNING! Probable error in the input file.
Individual 200, locus 1168;  encountered the following data
" when expecting an integer

WARNING! Probable error in the input file.
Individual 201, locus 1168;  encountered the following data
" when expecting an integer
----------------------------------
There were errors in the input file (listed above). According to
"mainparams" the input file should contain  201 rows with 2339 entries. .
There are 201 rows of data in the input file, with an average of 2339.00
entries per line.  The following shows the number of entries in each
line of the input file:
# Entries:   Line numbers
     2339:   1--201
 
Mainparams
 
KEY PARAMETERS FOR THE PROGRAM structure.  YOU WILL NEED TO SET THESE
IN ORDER TO RUN THE PROGRAM.  VARIOUS OPTIONS CAN BE ADJUSTED IN THE
FILE extraparams.

"(int)" means that this takes an integer value.
"(B)"   means that this variable is Boolean
        (ie insert 1 for True, and 0 for False)
"(str)" means that this is a string (but not enclosed in quotes!)

Basic Program Parameters
#define MAXPOPS    2      // (int) number of populations assumed
#define BURNIN    20000   // (int) length of burnin period
#define NUMREPS   20000   // (int) number of MCMC reps after burnin
Input/Output files
#define INFILE   popBL1168.txt   // (str) name of input data file
#define OUTFILE  popBL1168_run_1_f //(str) name of output data file
Data file format
#define NUMINDS    201  // (int) number of diploid individuals in data file
#define NUMLOCI    1168   // (int) number of loci in data file
#define PLOIDY       2    // (int) ploidy of data
#define MISSING     -9    // (int) value given to missing genotype data
#define ONEROWPERIND 1    // (B) store data for individuals in a single line

#define LABEL     1    // (B) Input file contains individual labels
#define POPDATA   1     // (B) Input file contains a population identifier
#define POPFLAG   1    // (B) Input file contains a flag which says
                              whether to use popinfo when USEPOPINFO==1
#define LOCDATA   0     // (B) Input file contains a location identifier
#define PHENOTYPE 0     // (B) Input file contains phenotype information
#define EXTRACOLS 0     // (int) Number of additional columns of data
                             before the genotype data start.
#define MARKERNAMES      0  // (B) data file contains row of marker names
#define RECESSIVEALLELES 0  // (B) data file contains dominant markers (eg AFLPs)
                            // and a row to indicate which alleles are recessive
#define MAPDISTANCES     0  // (B) data file contains row of map distances
                            // between loci

Advanced data file options
#define PHASED           0 // (B) Data are in correct phase (relevant for linkage model only)
#define PHASEINFO        0 // (B) the data for each individual contains a line
                                  indicating phase (linkage model)
#define MARKOVPHASE      0 // (B) the phase info follows a Markov model.
#define NOTAMBIGUOUS  -999 // (int) for use in some analyses of polyploid data
 
Command line options:
-m mainparams
-e extraparams
-s stratparams
-K MAXPOPS
-L NUMLOCI
-N NUMINDS
-i input file
-o output file
-D SEED
 
 

Vikram Chhatre

unread,
May 9, 2012, 10:37:10 PM5/9/12
to structure...@googlegroups.com
There is probably some end of line character at the end of each line
which is interfering with program operation. If you open a windows
edited text file in linux, the end of line characters are differently
formatted. On linux, open the data file in vim and check if you have
any unusual characters in the file.

If this doesn't solve the problem, feel free to send me *zipped*
version of your data and mainparams off the list and I will try to
replicate the error here.

HTH
V
> --
> You received this message because you are subscribed to the Google Groups
> "structure-software" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/structure-software/-/sN378-jG0IYJ.
> To post to this group, send email to structure...@googlegroups.com.
> To unsubscribe from this group, send email to
> structure-softw...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/structure-software?hl=en.

Junli Zhang

unread,
May 9, 2012, 10:50:45 PM5/9/12
to structure...@googlegroups.com
Hi,

I agree with Vikram. I met this problem before. I saved the data in text file from windows and used it in Linux, and STRUCTURE told me the column and line number was not right. So I opened the txt file using Gedit and save it as Linux line ending, then it worked.

Junli
--
Junli

Shalanee Weerasinghe

unread,
May 9, 2012, 11:03:58 PM5/9/12
to structure...@googlegroups.com
Thanks Vikram. You are doing a great job. Yes, it has formatted different
way at the end. Now it's working

Shalanee

Adii_ (Institute of Genetics and Animal Breeding)

unread,
May 11, 2012, 3:37:58 AM5/11/12
to structure...@googlegroups.com
Most offend problem is EOL symbol from Windows "^M"
The simple way to solve this problem, is to use 'tr' command in console. 

for example:

tr -d "\015" < input_file > output_file 

more info in
man tr

All Best,
Adii_

Adii_ (Institute of Genetics and Animal Breeding)

unread,
May 11, 2012, 3:54:09 AM5/11/12
to structure...@googlegroups.com

Ahmed Sallam

unread,
Dec 7, 2016, 4:56:27 PM12/7/16
to structure-software
Reply all
Reply to author
Forward
0 new messages