⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interface.c

📁 经典生物信息学多序列比对工具clustalw
💻 C
📖 第 1 页 / 共 5 页
字号:
		no_hyd_penalties = TRUE;/*** ? /novgap  */	if(setnovgap != -1)		no_var_penalties = FALSE;/*** ? /hgapresidues="string"  */	if(sethgapres != -1)		if(strlen(param_arg[sethgapres]) > 0) {			for (i=0;i<strlen(hyd_residues) && i<26;i++) {				c = param_arg[sethgapres][i];				if (isalpha(c))					hyd_residues[i] = (char)toupper(c);				else					break;			}		}				/*** ? /nosecstr1  */	if(setsecstr1 != -1)		use_ss1 = FALSE;/*** ? /nosecstr2  */	if(setsecstr2 != -1)		use_ss2 = FALSE;/*** ? /secstroutput  */	if(setsecstroutput != -1)		if(strlen(param_arg[setsecstroutput]) > 0) {			temp = find_match(param_arg[setsecstroutput],outputsecstr_arg,4);			if(temp >= 0 && temp <= 3)				output_struct_penalties = temp;			else				fprintf(stdout,"\nUnknown case %s\n",				param_arg[setsecstroutput]);		}/*** ? /helixgap= n */	if(sethelixgap != -1) {		temp = 0;		if(strlen(param_arg[sethelixgap]) > 0)			if (sscanf(param_arg[sethelixgap],"%d",&temp)!=1) {                         fprintf(stdout,"Bad option for /helixgap (must be integer)\n");                         temp = 0;                    }		if (temp >= 1 && temp <= 9)			helix_penalty = temp;	}	/*** ? /strandgap= n */	if(setstrandgap != -1) {		temp = 0;		if(strlen(param_arg[setstrandgap]) > 0)			if (sscanf(param_arg[setstrandgap],"%d",&temp)!=1) {                         fprintf(stdout,"Bad option for /strandgap (must be integer)\n");                         temp = 0;                    }		if (temp >= 1 && temp <= 9)			strand_penalty = temp;	}	/*** ? /loopgap= n */	if(setloopgap != -1) {		temp = 0;		if(strlen(param_arg[setloopgap]) > 0)			if (sscanf(param_arg[setloopgap],"%d",&temp)!=1) {                         fprintf(stdout,"Bad option for /loopgap (must be integer)\n");                         temp = 0;                    }		if (temp >= 1 && temp <= 9)			loop_penalty = temp;	}/*** ? /terminalgap= n */	if(setterminalgap != -1) {		temp = 0;		if(strlen(param_arg[setterminalgap]) > 0)			if (sscanf(param_arg[setterminalgap],"%d",&temp)!=1) {                         fprintf(stdout,"Bad option for /terminalgap (must be integer)\n");                         temp = 0;                    }		if (temp >= 1 && temp <= 9) {			helix_end_penalty = temp;			strand_end_penalty = temp;		}	}	/*** ? /helixendin= n */	if(sethelixendin != -1) {		temp = 0;		if(strlen(param_arg[sethelixendin]) > 0)			if (sscanf(param_arg[sethelixendin],"%d",&temp)!=1) {                         fprintf(stdout,"Bad option for /helixendin (must be integer)\n");                         temp = 0;                    }		if (temp >= 0 && temp <= 3)			helix_end_minus = temp;	}/*** ? /helixendout= n */	if(sethelixendout != -1) {		temp = 0;		if(strlen(param_arg[sethelixendout]) > 0)			if (sscanf(param_arg[sethelixendout],"%d",&temp)!=1) {                         fprintf(stdout,"Bad option for /helixendout (must be integer)\n");                         temp = 0;                    }		if (temp >= 0 && temp <= 3)			helix_end_plus = temp;	}/*** ? /strandendin= n */	if(setstrandendin != -1) {		temp = 0;		if(strlen(param_arg[setstrandendin]) > 0)			if (sscanf(param_arg[setstrandendin],"%d",&temp)!=1) {                         fprintf(stdout,"Bad option for /strandendin (must be integer)\n");                         temp = 0;                    }		if (temp >= 0 && temp <= 3)			strand_end_minus = temp;	}/*** ? /strandendout= n */	if(setstrandendout != -1) {		temp = 0;		if(strlen(param_arg[setstrandendout]) > 0)			if (sscanf(param_arg[setstrandendout],"%d",&temp)!=1) {                         fprintf(stdout,"Bad option for /strandendout (must be integer)\n");                         temp = 0;                    }		if (temp >= 0 && temp <= 3)			strand_end_plus = temp;	}} #ifdef UNIXFILE *open_path(char *fname)  /* to open in read-only file fname searching for 				 it through all path directories */{#define Mxdir 70        char dir[Mxdir+1], *path, *deb, *fin;        FILE *fich;        sint lf, ltot;	char *path1;         path=getenv("PATH"); 	/* get the list of path directories, 					separated by :    				*/	/* added for File System Standards  - Francois */	path1=(char *)ckalloc((strlen(path)+64)*sizeof(char));	strcpy(path1,path);	strcat(path1,"/usr/share/clustalx:/usr/local/share/clustalx");         lf=(sint)strlen(fname);        deb=path1;        do                {                fin=strchr(deb,':');                if(fin!=NULL)                        { strncpy(dir,deb,fin-deb); ltot=fin-deb; }                else                        { strcpy(dir,deb); ltot=(sint)strlen(dir); }                /* now one directory is in string dir */                if( ltot + lf + 1 <= Mxdir)                        {                        dir[ltot]='/';                        strcpy(dir+ltot+1,fname); /* now dir is appended with fi   lename */                        if( (fich = fopen(dir,"r") ) != NULL) break;                        }                else fich = NULL;                deb=fin+1;                }        while (fin != NULL);        return fich;}#endifvoid get_help(char help_pointer)    /* Help procedure */{		FILE *help_file;	sint  i, number, nlines;	Boolean found_help;	char temp[MAXLINE+1];	char token = '\0';	char *digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";	char *help_marker    = ">>HELP";	extern char *help_file_name;#ifdef VMS        if((help_file=fopen(help_file_name,"r","rat=cr","rfm=var"))==NULL) {            error("Cannot open help file [%s]",help_file_name);            return;        }#else#ifdef UNIX        if((help_file=open_path(help_file_name))==NULL) {             if((help_file=fopen(help_file_name,"r"))==NULL) {                  error("Cannot open help file [%s]",help_file_name);                  return;             }        }        #else        if((help_file=fopen(help_file_name,"r"))==NULL) {            error("Cannot open help file [%s]",help_file_name);            return;        }#endif#endif/*		error("Cannot open help file [%s]",help_file_name);		return;	}*/	nlines = 0;	number = -1;	found_help = FALSE;	while(TRUE) {		if(fgets(temp,MAXLINE+1,help_file) == NULL) {			if(!found_help)				error("No help found in help file");			fclose(help_file);			return;		}		if(strstr(temp,help_marker)) {                        token = ' ';			for(i=strlen(help_marker); i<8; i++)				if(strchr(digits, temp[i])) {					token = temp[i];					break;				}		}		if(token == help_pointer) {			found_help = TRUE;			while(fgets(temp,MAXLINE+1,help_file)) {				if(strstr(temp, help_marker)){				  	if(usemenu) {						fprintf(stdout,"\n");				    		getstr("Press [RETURN] to continue",lin2);				  	}					fclose(help_file);					return;				}				if(temp[0]!='<') {			       		fputs(temp,stdout);			       		++nlines;				}			       if(usemenu) {			          if(nlines >= PAGE_LEN) {				     	   fprintf(stdout,"\n");			 	  	   getstr("Press [RETURN] to continue or  X  to stop",lin2);				  	   if(toupper(*lin2) == 'X') {						   fclose(help_file);						   return;				  	   }				  	   else						   nlines = 0;				   }			       }			}			if(usemenu) {				fprintf(stdout,"\n");				getstr("Press [RETURN] to continue",lin2);			}			fclose(help_file);		}	}}static void show_aln(void)         /* Alignment screen display procedure */{        FILE *file;        sint  nlines;        char temp[MAXLINE+1];        char file_name[FILENAMELEN+1];        if(output_clustal) strcpy(file_name,clustal_outname);        else if(output_nbrf) strcpy(file_name,nbrf_outname);        else if(output_gcg) strcpy(file_name,gcg_outname);        else if(output_phylip) strcpy(file_name,phylip_outname);        else if(output_gde) strcpy(file_name,gde_outname);        else if(output_nexus) strcpy(file_name,nexus_outname);        else if(output_fasta) strcpy(file_name,fasta_outname);#ifdef VMS        if((file=fopen(file_name,"r","rat=cr","rfm=var"))==NULL) {#else        if((file=fopen(file_name,"r"))==NULL) {#endif                error("Cannot open file [%s]",file_name);                return;        }        fprintf(stdout,"\n\n");        nlines = 0;        while(fgets(temp,MAXLINE+1,file)) {                fputs(temp,stdout);                ++nlines;                if(nlines >= PAGE_LEN) {                        fprintf(stdout,"\n");                        getstr("Press [RETURN] to continue or  X  to stop",lin2);                        if(toupper(*lin2) == 'X') {                                fclose(file);                                return;                        }                        else                                nlines = 0;                }        }        fclose(file);        fprintf(stdout,"\n");        getstr("Press [RETURN] to continue",lin2);}void parse_params(Boolean xmenus){	sint i,j,len,temp;	static sint cl_error_code=0;        char path[FILENAMELEN];	Boolean do_align, do_convert, do_align_only, do_tree_only, do_tree, do_boot, do_profile, do_something;	if (!xmenus)	{		fprintf(stdout,"\n\n\n");		fprintf(stdout," CLUSTAL %s Multiple Sequence Alignments\n\n\n",revision_level);	}	do_align = do_convert = do_align_only = do_tree_only = do_tree = do_boot = do_profile = do_something = FALSE;	*seqname=EOS;/* JULIE 	len=(sint)strlen(paramstr);   Stop converting command line to lower case - unix, mac, pc are case sensitive	for(i=0;i<len;++i) paramstr[i]=tolower(paramstr[i]);*/    numparams = check_param(args, params, param_arg);	if (numparams <0) exit(1);	if(sethelp != -1) {		get_help('9');		exit(1);	}	if(setoptions != -1) {		fprintf(stdout,"clustalw option list:-\n");		for (i=0;cmd_line_verb[i].str[0] != '\0';i++) {			fprintf(stdout,"\t\t%c%s%s",COMMANDSEP,cmd_line_verb[i].str,cmd_line_type[cmd_line_verb[i].type]);			if (cmd_line_verb[i].type == OPTARG) {				if (cmd_line_verb[i].arg[0][0] != '\0')					fprintf(stdout,"=%s",cmd_line_verb[i].arg[0]);				for (j=1;cmd_line_verb[i].arg[j][0] != '\0';j++)					fprintf(stdout," OR %s",cmd_line_verb[i].arg[j]);			}			fprintf(stdout,"\n");		}		for (i=0;cmd_line_file[i].str[0] != '\0';i++) {			fprintf(stdout,"\t\t%c%s%s",COMMANDSEP,cmd_line_file[i].str,cmd_line_type[cmd_line_file[i].type]);			if (cmd_line_file[i].type == OPTARG) {				if (cmd_line_file[i].arg[0][0] != '\0')					fprintf(stdout,"=%s",cmd_line_file[i].arg[0]);				for (j=1;cmd_line_file[i].arg[j][0] != '\0';j++)					fprintf(stdout," OR %s",cmd_line_file[i].arg[j]);			}			fprintf(stdout,"\n");		}		for (i=0;cmd_line_para[i].str[0] != '\0';i++) {			fprintf(stdout,"\t\t%c%s%s",COMMANDSEP,cmd_line_para[i].str,cmd_line_type[cmd_line_para[i].type]);			if (cmd_line_para[i].type == OPTARG) {				if (cmd_line_para[i].arg[0][0] != '\0')					fprintf(stdout,"=%s",cmd_line_para[i].arg[0]);				for (j=1;cmd_line_para[i].arg[j][0] != '\0';j++)					fprintf(stdout," OR %s",cmd_line_para[i].arg[j]);			}			fprintf(stdout,"\n");		}		exit(1);	}/*****************************************************************************//*  Check to see if sequence type is explicitely stated..override ************//* the automatic checking (DNA or Protein).   /type=d or /type=p *************//*****************************************************************************/	if(settype != -1)		if(strlen(param_arg[settype])>0) {			temp = find_match(param_arg[settype],type_arg,2);			if(temp == 0) {				dnaflag = FALSE;				explicit_dnaflag = TRUE;				info("Sequence type explicitly set to Protein");			}			else if(temp == 1) {				info("Sequence type explicitly set to DNA");				dnaflag = TRUE;				explicit_dnaflag = TRUE;			}			else				fprintf(stdout,"\nUnknown sequence type %s\n",				param_arg[settype]);		}/****************************************************************************   check to see if 1st parameter does not start with '/' i.e. look for an **   input file as first parameter.   The input file can also be specified  **   by /infile=fname.                                                      *****************************************************************************//* JULIE - moved to check_param()	if(paramstr[0] != '/') {		strcpy(seqname, params[0]);	}*//**************************************************//*  Look for /infile=file.ext on the command line *//**************************************************/	if(setinfile != -1) {		if(strlen(param_arg[setinfile]) <= 0) {			error("Bad sequence file name");			exit(1);		}		strcpy(seqname, param_arg[setinfile]);	}	if(*seqname != EOS) {		profile_no = 0;		nseqs = readseqs((sint)1);		if(nseqs < 2) {			if(nseqs < 0) cl_error_code = 2;			else if(nseqs == 0) cl_error_code = 3;			else cl_error_code = 4;                	fprintf(stdout,			"\nNo. of seqs. read = %d. No alignment!\n",(pint)nseqs);			exit(cl_error_code);		}		for(i = 1; i<=nseqs; i++) 			info("Sequence %d: %-*s   %6.d %s",			(pint)i,max_names,names[i],(pint)seqlen_array[i],dnaflag?"bp":"aa");		empty = FALSE;		do_something = TRUE;	}	set_optional_param();/*********************************************************//* Look for /profile1=file.ext  AND  /profile2=file2.ext *//* You must give both file names OR neither.             *//*********************************************************/	if(setprofile1 != -1) {		if(strlen(param_arg[setprofile1]) <= 0) {			error("Bad profile 1 file name");			exit(1);		}		strcpy(seqname, param_arg[setprofile1]);		profile_no = 1;		profile_input();		if(nseqs <= 0) {			if(nseqs<0) cl_error_code=2;			else if(nseqs==0) cl_error_code=3;			exit(cl_error_code);		}		strcpy(profile1_name,seqname);	}	if(setprofile2 != -1) {		if(strlen(param_arg[setprofile2]) <= 0) {			error("Bad profile 2 file name");			exit(1);		}		if(profile1_empty) {			error("Only 1 profile file (profile 2) specified.");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -