Exemplo n.º 1
0
main ()
{
  long    end;			/* end of DNA sequence segment */
  char    header [ MAX_LINE ];	/* FASTA file format header line */
  t_text  in;			/* input DNA sequence file */
  int     index;		/* commands files index */
  t_text  library;		/* library of DNA sequences */
  t_text  names;		/* file of sequence names file */
  t_seq   seq;         		/* DNA sequence */
  long    start;		/* start of DNA sequence segment */
  int     version;     		/* DNA segment number */
  char    version_str [ MAX_LINE ];	/* ascii version number */
  FILE    *fopen ();		/* file open function */


  printf ( "This is the Sequence files --> Fasta format program.\n\n" );

  /* Prompt for the input file name. */
  prompt_file ( &names, "What is the list of sequences file name?" );

  /* Open the DNA library output file. */
  d_strcpy ( library.name, names.name );
  library.name [ d_stridx ( library.name, "\n" ) ] = '\0';
  library.name [ d_stridx ( library.name, "." ) ] = '\0';
  d_strcat ( library.name, ".Library" );
  library.data = fopen ( library.name, "w" );

  /* Process the sequences. */
  while ( names.eof != TRUE )
  {
    /* Open the sequence output file. */
    d_strcpy ( in.name, names.line );
    in.name [ d_stridx ( in.name, "\n" ) ] = '\0';

    /* Open the DNA sequence file for reading. */
    open_text_file ( &in );

    /* Read in the DNA sequence. */
    read_DNA_seq ( &in, &seq );
    fclose ( in.data );

    /* Set up the name of the DNA sequence file. */
    names.line [ d_stridx ( names.line, "\n" ) ] = '\0';
    d_strcpy ( seq.name, names.line );
    seq.name [ d_stridx ( seq.name, "." ) ] = '\0';

    /* Write out the library name line. */
    write_fasta_name ( &library, seq.name, 1, seq.total, seq.total );

    /* Write out the library DNA sequence. */
    write_DNA_seq ( &seq, 0, seq.total - 1, &library );

    /* Get the next name. */
    get_line ( &names );
  }  /* while */

  fclose ( library.data );

  printf ( "\nEnd of DNA Sequences -> Fasta format program.\n" );
}  /* main */
Exemplo n.º 2
0
main ()
{
  t_text  fof;			/* file of filenames */
  t_text  in;			/* input DNA sequence file */
  t_text  repeat;		/* repeat list for FATAL: errors */
  t_text  results;		/* Summary of Blast results */
  t_text  trace;		/* trace report */
  FILE    *fopen ();		/* file open function */


  printf ( "This is the Blast e-mail response output parsing program.\n\n" );

  /* Open the commands file. */
  results.data = fopen ( "results", "w" );

  /* Open the repeat list for FATAL: errors. */
  repeat.data = fopen ( "repeat", "w" );

  /* Open debug trace file. */
  trace.data = fopen ( "trace", "w" );

  /* Prompt for the input file name. */
  prompt_file ( &fof, "What is the list of sequences file name?" );

  /* Process the sequences. */
  while ( fof.eof != TRUE )
  {
    /* Open the sequence output file. */
    strcpy ( in.name, fof.line );
    in.name [ stridx ( in.name, "\n" ) ] = '\0';

    /* Open the DNA sequence file for reading. */
    open_text_file ( &in );

    /* Process the BLAST results file. */
    if ( fof.eof != TRUE )

      process_blast ( &in, &results, &repeat, &trace );

    /* Get the next file name. */
    get_line ( &fof );
 
    /* Close the BLAST results file. */ 
    fclose ( in.data );
  }  /* while */

  /* Close the commands file. */
  fclose ( fof.data );
  fclose ( results.data );
  fclose ( repeat.data );
  fclose ( trace.data );

  printf ( "\nEnd of program.\n" );
}  /* main */
Exemplo n.º 3
0
main ()
{
  long    end;		/* end of DNA sequence segment */
  t_text  in;		/* input DNA sequence file */
  long    index;        /* line index */
  t_text  trapped;	/* trapped exons sequence file */
  t_seq   seq;          /* DNA sequence */
  t_text  sequence;	/* trapped exon sequence */
  long    start;	/* start of DNA sequence segment */
  int     version;      /* DNA segment number */
  char    version_str [ MAX_LINE ];	/* ascii version number */
  FILE    *fopen ();	/* file open function */


  printf ( "This is the Sequence files --> DNA sequence program.\n\n" );

  /* Prompt for the input file name. */
  prompt_file ( &trapped, "What is the list of sequences file name?" );

  /* Process the sequences. */
  while ( trapped.eof != TRUE )
  {
    /* Open the sequence output file. */
    strcpy ( in.name, trapped.line );
    in.name [ stridx ( in.name, "\n" ) ] = '\0';

    /* Open the DNA sequence file for reading. */
    open_text_file ( &in );

    /* Read in the DNA sequence. */
    read_DNA_seq ( &in, &seq );
    fclose ( in.data );

/* printf ( "DNA length = %d\n", seq.total ); */

    version = 0;
    start = 0;
    end = 999;
    trapped.line [ stridx ( trapped.line, "\n" ) ] = '\0';

    /* Segment the DNA sequence in blocks of 1000 bp. */
    while ( start + MIN_SEQ < seq.total )
    {
      /* Truncate source name at first period. */
      strcpy ( sequence.name, trapped.line );
      sequence.name [ stridx ( sequence.name, "." ) ] = '\0';
      strcat ( sequence.name, "." );
      itoa   ( version, version_str );
      strcat ( sequence.name, version_str );
      sequence.data = fopen ( sequence.name, "w" );

      if ( ( trapped.eof != TRUE ) && ( sequence.data != NULL ) )
      {
        /* Check for end of sequence. */
        if ( end > seq.total )  end = seq.total;

        /* Write out the DNA sequence. */
        write_DNA_seq ( &seq, start, end, &sequence );

        fclose ( sequence.data );
        version++;
        start += 1000;
        end += 1000;
      }  /* if */
    }  /* while */

    /* Get the trapped exon name and sequence. */
    get_line ( &trapped );
  }  /* while */
}  /* main */
Exemplo n.º 4
0
//----------------------------------------------------------------------------------------------------------------------
// WM_COMMAND
//----------------------------------------------------------------------------------------------------------------------
void cWinMain :: wm_command ( WPARAM wParam, LPARAM lParam )
{
	UNREFERENCED_PARAMETER ( lParam );
	UNREFERENCED_PARAMETER ( wParam );

	WORD wID    = LOWORD(wParam);
	WORD wEvent = HIWORD(wParam);

	UNREFERENCED_PARAMETER ( wEvent );

	switch ( wID )
	{
	case ID_ABOUT:
		{
			cDlgAbout d;
			d.make_dlg();
		}
		break;

	case ID_ACTIVE_WINDOW_TRACKING_SETTINGS:
		{
			cDlgSettingsActiveWindowTracking d;
			d.make_dlg ();
		}
		break;

	case ID_APPEARANCE_SETTINGS:
		{
			cDlgSettingsAppearance d;
			d.make_dlg ();
		}
		break;

	case ID_CLEAR:
		PostMessage ( DlgMonitor.hwnd, WM_COMMAND, ID_CLEAR, ID_CLEAR );
		break;

	case ID_CONNECTION_SETTINGS:
		{
			cDlgSettingsConnection d;
			d.make_dlg ();
		}
		break;

	case ID_CREATE_DESKTOP_SHORTCUT:
		create_click_once_shortcut ();
		break;

	case ID_EXIT:
		DestroyWindow(hwnd);
		break;

	case ID_MOUSEOVER_SETTINGS:
		{
			cDlgMouseOver d;
			d.make_dlg ();
		}
		break;

	case ID_PERFORMANCE_SETTINGS:
		{
			cDlgSettingsPerformance d;
			d.make_dlg ();
		}
		break;

	case ID_PREDEFINED_HOTKEYS:
		{
			cFigPredefinedHotkeys * p = g_FigMgr.get_predefined_hotkeys();
			cDlgFigPredefinedHotkeys d;
			d.make_dlg ( p );
		}
		break;

	case ID_SHOW_APP_LOG:
		show_app_data_file ( L"mojo.log.txt" );
		break;

	case ID_SHOW_APP_SETTINGS:
		show_app_data_file ( L"mojo.settings.txt" );
		break;

	case ID_SHOW_ENGINE_LOG:
		show_app_data_file ( L"mojo_engine.log.txt" );
		break;

	case ID_SHOW_ENGINE_SETTINGS:
		show_app_data_file ( L"mojo_engine.settings.txt" );
		break;

	case ID_SHOW_INSTALLATION_DIRECTORY:
		{
			cStrW s1, s2;
			s1 = L"Location of Mojo's executable files:\n\n";
			get_module_directory ( & s2 );
			s1 += s2;
			message_box ( s1.cstr() );
		}
		break;

	case ID_SHOW_LICENSE_DIALOG:
		{
			cDlgLicense d;
			d.make_dlg();
		}
		break;

	case ID_TEST:
		::test ();
		break;

	case ID_TEST_SET_TRIGGER:
		{
			cDlgSetTrigger d;
			mojo::cTrigger t;
			d.make_dlg(&t);
		}

	case ID_TOGGLE_BROADCAST:
		toggle_broadcast ();
		break;

	case ID_TOGGLE_HOTKEYS:
		toggle_hotkeys ();
		message_box ( L"Hotkeys aren't implemented yet." );
		break;

	case ID_TOGGLE_MOUSEOVER:
		toggle_mouseover ();
		break;



	case ID_VIEW_COMPUTERS:
		g_Settings.uView = computers;
		set_view();
		break;

	case ID_VIEW_MONITOR:
		g_Settings.uView = monitor;
		set_view();
		break;

	case ID_VIEW_TOONS:
		g_Settings.uView = toons;
		set_view();
		break;

	case ID_VIEW_WOWS:
		g_Settings.uView = wows;
		set_view();
		break;

#if 0
		case ID_RESTORE_DEFAULT_SETTINGS:
			g_Settings.restore_defaults();
			break;

		case ID_SETTINGS_MOUSEOVER:
			{
				cDlgMouseOver d;
				d.make_dlg();
			}
			break;

		case ID_HIDE_HOTKEYNET:
			set_tray_icon ();
			ShowWindow ( g_hwnd, SW_HIDE );
			break;

		case ID_TOGGLE_SHOW_STATE:
			ShowWindow ( g_hwnd, IsWindowVisible(g_hwnd) ? SW_HIDE : SW_RESTORE );
			break;

		case ID_TOGGLE_HOTKEYS:
			toggle_hotkeys();
			break;

		case ID_DEBUG:
			debug();
			break;

		case ID_ASK_QUESTION:
			show_forum();
			break;

		case ID_REPORT_BUG:
			report_bug ();
			break;

		case ID_INSTRUCTIONS:
			show_instructions ();
			break;

		case ID_SETTINGS_CONNECTION:
			{
				cDlgSettingsConnection d;
				d.make_dlg();
			}
			break;

		case ID_SETTINGS_SECURITY:
			{
				cDlgSettingsSecurity d;
				d.make_dlg();
			}
			break;

		case ID_SETTINGS_START_UP:
			{
				cDlgSettingsStartUp d;
				d.make_dlg();
			}
			break;

		case ID_SETTINGS_DISPLAY:
			{
				cDlgSettingsDisplay d;
				d.make_dlg();
			}
			break;

		case ID_INSTALLATION_OPTIONS:
			installation_options ();
			break;

		case ID_CREATE_SHORTCUT:
			create_clickonce_shortcut ();
			break;

		case ID_CREATE_SCRIPT:
			if ( create_script () )
				load_script_sub();
			break;

		case ID_OPEN_DEBUG_LOG:
			open_text_file ( g_Log.filename() );
			break;

		case ID_LOAD_SCRIPT:
			g_Monitor.clear();
			load_script();
			break;

		case ID_RELOAD_SCRIPT:
			g_Monitor.clear();
			load_script_sub ();
			break;

		case ID_EDIT_SCRIPT:
			edit_script();
			break;

		case IDM_ABOUT:
			{
				cDlgMessageBox d;
				d.make_dlg();
			}
			break;
#endif
	}
}